user3202898
user3202898

Reputation: 1

asp contact form not send to email

Hi im doing a ASP contact form and for some reason i keep getting this.

Server object error 'ASP 0177 : 800401f3'

Server.CreateObject Failed

/confirmation.asp, line 10

800401f3

I think that theres something wrong with my SMTP, please any help would be grateful.

<%
DIM strEmail, strFirstName, strLastName, strSubject, strComments
strEmail = request.form("Email")
strFirstName = request.form("FirstName")
strLastName = request.form("LastName")
strSubject = request.form("Subject")
strComments = request.form("Comments")

DIM Mailer,strMsgHeader, qryItem, strMsgInfo
Set Mailer = Server.CreateObject("smtpout.secureserver.net")//this line might be wrong.
Mailer.FromName = "Web Designs"
Mailer.FromAddress= "[email protected]"
Mailer.ReplyTo = strEmail
Mailer.RemoteHost = "mail.example.net"
Mailer.AddRecipient "", ""
Mailer.Subject = "Online Inquiry"
strMsgHeader = "This mail message was sent from the Online Form"   &   vbCrLf & vbCrLf
Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
vbCrLf & "First Name: " & Request.Form("FirstName") & _
vbCrLf & "Last Name: " & Request.Form("LastName") & _
vbCrLf & "Subject: " & Request.Form("Subject") & _
vbCrLf & "Comments: " & Request.Form("Comments")

IF Mailer.SendMail THEN
Response.Write strFirstName & ",<br>"
Response.Write "Your message has been successfully sent."
ELSE
Response.Write "The following error occurred while sending your message: " & Mailer.Response
END IF
%>

Upvotes: 0

Views: 318

Answers (1)

kloarubeek
kloarubeek

Reputation: 2854

It seems you mix up the 'send email library' and your SMTP configuration.

the Mailer should look like

Set Mailer = Server.CreateObject("CDO.Message")

(although this could depend on your IIS version)

To configure your SMTP you should use this object:

Set cdoConfig = CreateObject("CDO.Configuration") 
cdoConfig.Fields.Item(cdoSMTPServer) = "smtpout.secureserver.net"

Edit: example code: CDO Classic ASP form not working

Upvotes: 1

Related Questions