I am trying to send an email from a website through the outlook server. It works fine to send one email, but if I try to send a second email it fails. I’ve tried different permutations, but here’s my current code:
mailServer.address = “smtp-mail.outlook.com”
mailServer.port = 587
mailserver.Connect 'don’t know if this is actually needed
if mailserver.Messages.Ubound>-1 then
’ if a previous message exists, this should clear it
'admmail.headers.appendHeader “X-Mailer”,“Match SMTP” 'added in open event of webpage
admmail.subject=webpage1.curlocation+" conference information"
admmail.BodyHTML="Here is information on the conference you requested :
admmail and mailserver are both properties of the webpage so should not go out of scope before sending. After sending the first time, there is an lasterrorcode of 102, which I’m not sure is significant. But after trying to send a second time, there is an error code of 336031996. I have also tried with the gmail server, and I get exactly the same result and error codes.
Any help would be appreciated.