I'm writing an application in classic ASP (yes, please forgive me) that sends e-mails using Google Mail. I have it working just fine like this:
Dim ObjSendMail
Set ObjSendMail = CreateObject("CDO.Message")
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = SendUsername
ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = SendPassword
ObjSendMail.Configuration.Fields.Update
ObjSendMail.To = "[email protected]"
ObjSendMail.From = "[email protected]
ObjSendMail.Subject = "subject here..."
ObjSendMail.HTMLBody = "body here..."
'ObjSendMail.Fields("urn:schemas:mailheader:disposition-notification-to") = SendUsername
'ObjSendMail.Fields("urn:schemas:mailheader:return-receipt-to") = SendUsername
'ObjSendMail.Fields.Update
'ObjSendMail.DSNOptions = 14
ObjSendMail.Send
Set ObjSendMail = Nothing
When I uncomment out the following lines:
'ObjSendMail.Fields("urn:schemas:mailheader:disposition-notification-to") = SendUsername
'ObjSendMail.Fields("urn:schemas:mailheader:return-receipt-to") = SendUsername
'ObjSendMail.Fields.Update
'ObjSendMail.DSNOptions = 14
The e-mail fails to send. No error, just no e-mail and no delivery receipt. I can't figure out for the life of me how to make this work. "SendUsername" is a valid e-mail address. Any help would be appreciated.