Hi guys, I am new to asp, and have been stuck in the middle of someone else's code trying to depict a problem. The below code is part o a script with sends an email contain, senders name & email , subject and request.
The interface used is a simple web form of textboxes and a text area.
The reciever(
[email protected])gets about 40 blank emails a day due to some error which I can't depict from the code!
Can anyone guide me in the right direction to fixing this problem?
Many Thanks- stephenmarron
<%
' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
strSubject = Request.form("user_subject")
strName = Request.form("user_name")
strEmail = Request.form("user_email")
strMsg = Request.form("user_text")
Const cdoSendUsingPort = 2
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "staffmail.xxxxxx.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> From :" & strName & " </b></br>"
strHTML = strHTML & "<b> Reply to : <a href='mailto:" & strEmail & "'>" & strEmail & " </a></b></br>"
strHTML = strHTML & "<b> Message : </b></br> " & strMsg & "</br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = "info\@xxxxx.com" 'ToDo: Enter a valid email address.
.From = "Contactus-WebForm\@xxxxx.com" 'ToDo: Enter a valid email address.
.Subject = strSubject
.HTMLBody = strHTML
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
%>