PDA

View Full Version : ASP programmers - urgent


cturner
09-20-2005, 08:18 PM
I have no way of checking the following code for errors and whether the form input will go to the email address cturner@askaussie.com. Can someone please help me? The form is below the asp code. Thanks in advance. Help is appreciated.


<%
Dim strtitle, strfullname, straddress, strphone, strfax, strmobile, stremail, strsubject, strmessage, Mail, strMsgHeader

strtitle = request.form("title")
strfullname = request.form("fullname")
straddress = request.form("address")
strphone = request.form("phone")
strfax = request.form("fax")
strmobile = request.form("mobile")
stremail = request.form("email")
strsubject = request.form("subject")
strmessage = request.form("message")

Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.askaussie.com"
Mail.From = stremail
Mail.AddAddress "cturner@askaussie.com"
Mail.Subject = ""
strMsgHeader = "This email was delivered from ccc.1asphost.com/bluegum." & vbCrLf & vbCrLf
Mail.Body = strMsgHeader & "Email: " & stremail & vbCrLf & _
"Title: " & strtitle & vbCrLf & _
"Full name: " & strfullname & vbCrLf & _
"Address: " & straddress & vbCrLf & vbCrLf & _
"Fax number: " & strfax & vbCrLf & vbCrLf & _
"Mobile number: " & strmobile & vbCrLf & vbCrLf & _
"E-mail address: " & strmobile & vbCrLf & vbCrLf & _
"Subject: " & strmobile & vbCrLf & vbCrLf & _
"Message: " & vbCrLf & strmessage
On Error Resume Next
Mail.Send
Set Mail = Nothing
IF Err <> 0 THEN
Response.Write "There has been an error and your message could not be sent through email. " & Err.Description
END IF
%>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title>
</head>
<body>
<form name="form" method="post" action="confirmation.asp">
<table width="500" border="0" cellspacing="1" cellpadding="1">
<tr>
<td width="118">Title:</td>
<td width="375"><input name="title" type="text" id="title"></td>
</tr>
<tr>
<td>Full name: </td>
<td><input name="fullname" type="text" id="fullname"></td>
</tr>
<tr>
<td>Address:</td>
<td><input name="address" type="text" id="address"></td>
</tr>
<tr>
<td>Phone number: </td>
<td><input name="phone" type="text" id="phone"></td>
</tr>
<tr>
<td>Fax number: </td>
<td><input name="fax" type="text" id="fax"></td>
</tr>
<tr>
<td>Mobile number: </td>
<td><input name="mobile" type="text" id="mobile"></td>
</tr>
<tr>
<td>E-mail address: </td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td>Subject:</td>
<td><input name="subject" type="text" id="subject"></td>
</tr>
<tr>
<td valign="top">Message:</td>
<td><textarea name="textarea"></textarea></td>
</tr>
<tr>
<td colspan="2"><input name="send" type="submit" id="send" value="SEND"></td>
</tr>
</table>
</form>
</body>
</html>

Kram
09-21-2005, 12:28 AM
what exactly do you want us to look at? Are you having issues with the form validation? Is the code you provided in a different page? Are you getting errors? Does the email sending give you errors? or are you just not understanding how forms and asp works?

I just want to be clear on the issues here

cturner
09-21-2005, 02:12 AM
I need someone to please look at the whole ASP code and tell me if it would produce any errors and whether it would send the email to cturner@askaussie.com as I don't have any way telling whether there would be errors (my hosting server doesn't have ASP installed). I am just beginning to learn ASP. I trying to learn ASP for a client of mine. He only has ASP installed on his hosting server.

smartweb
09-21-2005, 09:18 AM
It's not easy to tell if some code will work or not, by just looking at it. Make sure that the hosting company has Persits.MailSender object on their server.

cturner
09-21-2005, 06:19 PM
Then can someone please put it in an ASP installed server and test it for me?

putts
09-22-2005, 09:04 AM
The problem is that you're using Persits software - it might be free but it's not something that every ASP server is going to have.

Does your webhost have CDOSYS enabled or available? Or just Persits?

I might be able to try it out with Persits much later tonight but don't have the time during the day to install it and test everything with it when it's not something I have any experience with.

cturner
09-24-2005, 05:56 PM
Thanks for nothing guys. The hosting company is going to test it for me now.