I have installed ASPEmail and I have tested to be sure it is working with another form. Below is another form which I created and I can not get it to work.
Any help would be greatly appreciated.
Thanks,
Scott
Below is the code for sendmail.asp
Any help would be greatly appreciated.
Thanks,
Scott
Code:
<form name="Contact" method="Post" action="sendmail.asp">
<table>
<tr><td>Email: </td>
<td><input type="text" name="Email" size="50"></td></tr>
<tr><td>Name: </td>
<td><input type="text" name="Name" size="50"></td></tr>
<tr><td>Address: </td>
<td><input type="text" name="Address" size="50"></td></tr>
<tr><td>City: </td>
<td><input type="text" name="City" size="50"></td></tr>
<tr><td>State: </td>
<td><input type="text" name="State" size="50"></td></tr>
<tr><td>Zip: </td>
<td><input type="text" name="Zip" size="50"></td></tr>
<tr><td>Phone: </td>
<td><input type="text" name="Phone" size="50"></td></tr>
<tr><td>Subject: </td>
<td><input type="text" name="Subject" size="50"></td></tr>
<tr><td>Comments: </td>
<td><textarea name="Comments"></textarea></td>
</table>
<input type="submit" name="Submit" value="Submit Form">
</form>
Below is the code for sendmail.asp
Code:
<%
DIM strEmail, strName, strAddress, strCity, strState, strZip, strPhone, strSubject, strComments, Mail
strEmail = request.form("Email")
strName = request.form("Name")
strAddress = request.form("Address")
strCity = request.form("City")
strState = request.form("State")
strZip = request.form("Zip")
strPhone = request.form("Phone")
strSubject = request.form("Subject")
strComments = request.form("Comments")
DIM Mail, strMsgHeader
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = "mail.server.com"
Mail.From = strEmail
Mail.AddAddress "info@domain.com"
Mail.AddCC "user@domain.com"
Mail.Subject = "Comments from Website"
strMsgHeader = "This email was delivered from the Website." & vbCrLf & vbCrLf
Mail.Body = strMsgHeader & "Email: " & strEmail & vbCrLf & _
"Name: " & strName & vbCrLf & _
"Address: " & strAddress & vbCrLf & _
"City: " & strCity & vbCrLf & vbCrLf & _
"State: " & strState & vbCrLf & _
"Zip: " & strZip & vbCrLf & _
"Phone: " & strPhone & vbCrLf & _
"Subject: " & strSubject & vbCrLf & vbCrLf & _
"Comments: " & vbCrLf & strComments
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
%>
<P>
<%
Response.Write strFirstName & ",<br>"
Response.Write "Your message has been successfully sent."
%>,</P>