dimmergeek
asked on
Why is CDO message not getting out to external addresses?
I have an HTML form which solicits data and then passes it to an ASP page which formats and e-mails data out. It works GREAT with internal addresses within our company. As soon as I try to send to an external address, or mobile device, the whole thing crashes and I get:
error '8004020f'
/form/CMS/lean/hitCount/se nd_notice. asp, line 46
Line 46 is my mail.Send line
Why can't I send out??
Please see code below:
<%
when = Request.Form("when")
what = Request.Form("S_event")
where = Request.Form("line_name")
why = Request.Form("why")
message="At " &when & " an " &what & " for the " &where & " line due to " &why
set cdoConfig = CreateObject("CDO.Configur ation")
with cdoConfig.Fields
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="xxx.yyy.com"
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
.Update
end with
set myMail=CreateObject("CDO.M essage")
with myMail
set .Configuration = cdoConfig
.From="fake_address@mycomp any.com"
.Subject="Safety Notification"
.To="phone_number@carrier. net"
.TextBody=message
.Send
end with
set myMail = nothing
%>
error '8004020f'
/form/CMS/lean/hitCount/se
Line 46 is my mail.Send line
Why can't I send out??
Please see code below:
<%
when = Request.Form("when")
what = Request.Form("S_event")
where = Request.Form("line_name")
why = Request.Form("why")
message="At " &when & " an " &what & " for the " &where & " line due to " &why
set cdoConfig = CreateObject("CDO.Configur
with cdoConfig.Fields
.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver")="xxx.yyy.com"
.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=25
.Update
end with
set myMail=CreateObject("CDO.M
with myMail
set .Configuration = cdoConfig
.From="fake_address@mycomp
.Subject="Safety Notification"
.To="phone_number@carrier.
.TextBody=message
.Send
end with
set myMail = nothing
%>
ASKER
I added all that, (used my username and password for login to Exchange)
Get same error as before.
Is it possible this server can't send out and we use another server for that??
Get same error as before.
Is it possible this server can't send out and we use another server for that??
ASKER
Code works flawlessly with internal addresses. WILL NOT work when I try to send to ANYTHING external (cell phone, e-mail...)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not sure...I'm doing all this 'under the radar'
you have to set below values
.Item (http://schemas.microsoft.com/cdo/configuration/smtpauthenticate) = 1
.Item (http://schemas.microsoft.com/cdo/configuration/sendusername) = HostUsrname
.Item (http://schemas.microsoft.com/cdo/configuration/sendpassword) = HostPassword