Hi,
this is to help others on Windoze hosting plans who may be having problems setting their asp form to send them an email, feedback etc.
I was able to get the CDOSYS script working on my Windoze hosting plan after making the following modifications. That script can be found under asp in the knowledgebase website of Lunarpages:
https://support.lunarpages.com/knowledge_bases/article/273Note, my domain name is: ajmasters.com
1 - Make sure the email you use to send FROM does exist with your domain. i.e. you need to create an email with your domain name.
ex: I created this email:
fromWeb@ajmasters.com2- Make sure the email you send TO does exist with your domain. It did not work when trying to send to an email outside like
something@yahoo.com but it did ok when using my own. i.e. you need to create an email with your domain name. (you can then set that email to redirect outside if you want) ex: I created this email:
Tomyself@ajmasters.com3- Change the port from 25 to 2 on this line: Const cdoSendUsingPort = 2
Here is the script below, make the appropriate changes using your own domain name.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost
Const cdoSendUsingPort = 2
StrSmartHost = "localhost"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.Item("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
strBody = "This is a test of sending an email via ASP" & vbCrLf & vbCrLf
strBody = strBody & "This is line 2. " & vbCrLf
strBody = strBody & "you can have as many as you want" & vbCrLf
strBody = strBody & "THIS IS AN AUTOMATED EMAIL - PLEASE DO NOT REPLY"
With iMsg
Set .Configuration = iConf
.To = "
Tomyself@ajmasters.com"
.From = "
fromWeb@ajmasters.com"
.Subject = "LEADS FROM MY FORM "
.textbody = strBody
'redirect code goes here
.Send
End With
' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing