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>
<%
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>