I am trying to send an email from my .asp page and I am getting this error:
CDO.Message.1 error '80040213'
The transport failed to connect to the server.
.asp, line 232
Line 232 is:
.Send
My code on the submit page is:
Dim strSender
Dim strRecipientsName
Dim strRecipients
Dim strSubject
Dim strMessage
strRecipientsName = "me@hotmail.com"
strRecipients = Request.Form("txt_email")
strSubject = "From: " & Request.Form("txt_email") & " Picture"
strMessage = "Hello " & Request.Form("txt_query") & vbCrLf & vbCrLf
strMessage = strMessage & Request.Form("txt_query") & vbCrLf & vbCrLf
strMessage = strMessage & "You received this from : " & Request.Form("txt_email") & " " & Request.Form("txt_email")
strSender = Request.Form("txt_email")
If (("" & strSender) <> "" ) and (("" & strRecipients) <> "" ) Then
Set objMail = Server.CreateObject("CDO.M
essage")
With objMail
.From = strSender
.To = strRecipients
.Subject = strSubject
.HTMLBody = strMessage
.Configuration.Fields.Item
("
http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Configuration.Fields.Item
("
http://schemas.microsoft.com/cdo/configuration/smtpserver"
) = "ampsrc.com"
.Configuration.Fields.Item
("
http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Configuration.Fields.Upda
te
.Send
End With
Set objMail = Nothing
End
SQLINSERT = "INSERT INTO tbl_queries(name,date_appl
ied,email,
subject,qu
ery) values('" & replace(session ("name"), "'", "")& "',#" & date & "#,'" & replace(session ("email"), "'", "")& "','" & replace(session ("subject"), "'", "")& "','" & replace(session ("query"), "'", "")& "')"
objConn.execute(SQLINSERT)
Else
Response.write "There has been a prblem sending your email, please......"
End if
%>
Start Free Trial