I am a newbie to ASP and VBScript. I have a bizzare error that I have been trying to trouble shoot for about 2 days now. Essentially I have been jumping from one website to another to try and solve the problem.
Problem Description:
I am trying to use VBScript To Send Email Using CDO and this is code I have for it (with the credentials filtered)
Expand|Select|Wrap|Line Numbers
- sub request_recommendation(ID)
- insert_recommend_request(ID)
- dim cname
- cname = get_reference(request.form("csmp_id"))
- dim strSubject, emailText
- strSubject = "Recommendationp"
- emailText = "<b> " & cname & " is testing this email functionality.<br/>"
- 'Create the mail object
- Set objMessage = Server.CreateObject("CDO.message")
- objMessage.TO = request.form("email")
- objMessage.From = "myusername@mymail.com"
- objMessage.Subject = strSubject ' Specify the subject line
- objMessage.htmlBody = emailText
- 'Configs
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")= 2
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp-server.com"
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "myusername@mymail.com"
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "mypassword"
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25
- objMessage.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
- objMessage.Configuration.Fields.Update
- 'Enable send
- ON ERROR RESUME NEXT
- objMessage.Send
- set objMessage = nothing
- end sub
Someone mentioned that this may be due to a network problem. "They suggested checking to ensure the server System.Web.Mail is executing and can connect to the mail server. Because sometimes firewalls or proxy servers can get in the way."
Is anyone familiar with:
1)How to check if the server is executing and connecting to my mail server.
2) How to check if firewalls or proxy servers are getting in the way.
Detailed steps on how to carry out these checks will be greatly appreciated because I am not sure what the problem is and I am speculating that this may be the issue.
Any other suggestions may be helpful too but YES I have looked up a lot the forums that google returns and they haven't been helpful so far.
Thanks