Hurdle 2 is now complete! The host’s local SMTP server is not configured correctly. The website is hosting its pop/smtp email else where. Using Method 3 of Sending email using CDOSYS ( THE REAL DEAL ) I was able to finally get email to send!
Method 3 ( Using remote mail server )
<% Dim ObjSendMail Set ObjSendMail = CreateObject("CDO.Message") 'This section provides the configuration information for the remote SMTP server. ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Send the message using the network (SMTP over the network). ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="mail.yoursite.com" ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False 'Use SSL for the connection (True or False) ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ' If your server requires outgoing authentication uncomment the lines bleow and use a valid email address and password. 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") ="firstname.lastname@example.org" 'ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") ="yourpassword" ObjSendMail.Configuration.Fields.Update 'End remote SMTP server configuration section== ObjSendMail.To = "email@example.com" ObjSendMail.Subject = "this is the subject" ObjSendMail.From = "firstname.lastname@example.org" ' we are sending a text email.. simply switch the comments around to send an html email instead 'ObjSendMail.HTMLBody = "this is the body" ObjSendMail.TextBody = "this is the body" ObjSendMail.Send Set ObjSendMail = Nothing %>
In addition to what you see here there are plenty of properties you can add to these examples.
Here are a few examples.
ObjSendMail.CC = “email@example.com”
Blind Carbon Copy
ObjSendMail.BCC = “firstname.lastname@example.org”
Send Attachment (we hard code it here, but you could specify the file path using Server.Mappath as well)
and a ton of other things you can do…
Pages I found useful during this hurdle:
- CDOSYS or CDONTS, Which Will It Be?
- Send via ASP Page w CDONTS – Mail Stuck In SMTP Queue – Please help!
- Localhost mail stuck in QUEUE
- Mail Stuck in Queue Folder – IIS SMTP Virtual Server – Windows XP Service Pack 2 This one advised adding two crlf’s to the end of email.
See also Microsoft’s CDOSYS Documentation.
The final hurdle is rewriting their document management system. Presently, they have an admin piece that uploads documents to a single directory. The documents are then accessible to their customers. They want the ability to classify those documents. The approach will be to allow the documents to live in subdirectories representing the categories. This should be interesting.