PDA

View Full Version : error '8004020f' cdo.message ASP Email


morny
04-11-2005, 09:39 PM
Hello,

Im trying to set-up an automated email for a friend using cdo.message

I try the following code on my server and it works fine:




<%
sch = "http://schemas.microsoft.com/cdo/configuration/"

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "mail.myserver.com"
.update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "from@me.com"
.To = "webmaster@me.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing


response.write "sent, check the mail"
%>



That code actually works on my friends server (windows 2003) if he sends internal mail. However if he tries to send external mail he gets the fowllowing error:

error '8004020f'

/test3.asp, line 21

line 21 is: .Send

How can i solves this problem???

Thanks
Paul

BigPete
04-12-2005, 03:39 AM
http://www.aspfaq.com/show.asp?id=2305
maybe something there will help you.

csupport
10-08-2008, 12:41 AM
Please change mail.myserver.com to localhost


Thanks

CSupport

www.platoon.in

hinch
10-08-2008, 04:17 PM
perhaps the server your putting it on doesn't use CDO but instead has CDONTS ?

there's a link in my sig to a mail script that will auto detect which one is in use and correctly use it

brazenskies
10-08-2008, 07:36 PM
make sure that he has SMTP Server installed. You can check this in IIS.

I'm gonna guess it's not