-1

When I first created this Classic ASP script, with the help of W3Schools, to send email, it worked fine. Now I'm having issues with sending the actual email; it appears to hang on the .Send method.

I noticed that when I set the To and From email address to just the email address, it reformats it to a "Friendly Name"/Email Address format:

myMail.From="Support@myDomain.com"

Response.Write myMail.From

The output of the Response Write is:

"Support@myDomain.com" <Support@myDomain.com>

I don't know if this was happening before, or if I should be setting the To and From fields in this format. Just to check if this is causing my problem, is there anyway to prevent these fields from being changed from just the email address?

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
Howard Parr
  • 119
  • 8

2 Answers2

0

Maybe the e-mail sending from the server now needs some kind of authentication such as setting these fields:

' Outgoing SMTP server. objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.mydomain.com" objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objCDO.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ' Type of authentication, 0=NONE, 1-Basic (Base64 encoded), and 2=NTLM. objCDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 ' UserID on the SMTP server objCDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "support@mydomain.com" ' Password on the SMTP server objCDO.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "myemailpassword" ' Update config. objCDO.Configuration.Fields.Update

0

The issue stemmed from the fact that the "From" email address was actually a distribution list and the account credentials used to login to the email server were not authorized to "Send As". Once that was rectified emails sent without further problems.

Thanks for the response.

Howard Parr
  • 119
  • 8