windows server 2008 / IIS 7
so i've been using CDOSYS mymail functions for a while along with our office365 managed external mail provider.
it works and can send to any email address as long its within the same "email domain"..
however i have since found out that it fails when trying to send to any external email address, with the usual #error '8004020e' error.
what i can't understand is why it fails here, but when we use the exact same account/authentication details on a different system that auomates reports for us (jeffnet), then it is able to send to external address just fine.
so i can only assume it is either an IIS config issue or a code issue.
the code i am using is
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Mail Test"
myMail.To="default@example.com"
myMail.TextBody="Test"
myMail.From="blah@myoffice365email.com"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="smtp.office365.com"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=587
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 20
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "blah@myoffice365email.com"
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password123"
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>jeffnet uses just the following details
SMTP server : smtp.office365.com SMTP port : 587 mail account name : blah@myoffice365email.com authentication id : blah@myoffice365email.com authentication password : password123
so can anyone help with what the issue might be?
i can only assume it's not an office365 issue, otherwise jeffnet would also fail to send to external addresses.