%
Sub SendMail( from, emailTo, subject, message )
Const cdoSendUsingPort = 2
Const smartHost = "localhost" ' Chris, change this to the value hostway gives you.
Set cdoMail = Server.CreateObject("CDO.Message")
Set iConf = cdoMail.Configuration
'Set the fields of the configuration object to send by using SMTP through port 25.
With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smartHost
.Update
End With
cdoMail.From = from
cdoMail.To = emailTo
cdoMail.Subject = subject
cdoMail.HTMLBody = message
cdoMail.Send
Set cdoMail = nothing
End Sub
If Request.Form( "submit" ) = "Submit" Then
Dim message
Dim comments
comments = Replace( Request.Form( "comments" ), "\", "" )
comments = Replace( Request.Form( "comments" ), "/", "" )
message = "Metro Energy Savers Contact Form
" & _
"Sender's Name:......." + Request.Form("name") + "
" & _
"Phone:......." + Request.Form("phone") + "
" & _
"E-Mail:......." + Request.Form("email") + "
" & _
"Comments:......." + comments + "
" & _
"Day:......." + Request.Form("day") + "
" & _
"Date:......." + Request.Form("date") + "
" & _
"Time:......." + Request.Form("time") + "
" & _
"AM or PM:......." + Request.Form("ampm") + "
"
Call SendMail ( Request.Form("email"), "info@metroenergysavers.com", "Metro Energy Savers Contact Form", message )
Response.Redirect( "thankyou.php" )
End If
%>
![]() |
![]() |
||