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
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