PDA

View Full Version : CDO Message not sending


bebemau
11-02-2003, 09:32 AM
Hello again,

I read the knowledge base here and found the article on how to use the CDO object. So I basically copied everything and my page runs fine however, the mail did not get sent. Do I have to change the smtp server or the sendusing field?

Heres my code:
set myMessage=createObject("cdo.message")
set myConfig=createObject("cdo.configuration")
set myFields=myConfig.Fields
myFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
myFields.update

Set myMessage.Configuration = myConfig
myMessage.to="sender@domain.com"
myMessage.From = "receipient@domain.com"
myMessage.Subject = "A prayer was sent"
myMessage.TextBody = strBody
myMessage.Fields.update
myMessage.Send
set myFields=nothing
set myMessage=nothing
set myConfig=nothing

Thanks in advance

bruce
11-05-2003, 08:04 AM
No. You need not change those fields.

Make sure the from & to address is valid.

[b]quote:Originally posted by bebemau

Hello again,

I read the knowledge base here and found the article on how to use the CDO object. So I basically copied everything and my page runs fine however, the mail did not get sent. Do I have to change the smtp server or the sendusing field?

Heres my code:
set myMessage=createObject("cdo.message")
set myConfig=createObject("cdo.configuration")
set myFields=myConfig.Fields
myFields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
myFields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
myFields.update

Set myMessage.Configuration = myConfig
myMessage.to="sender@domain.com"
myMessage.From = "receipient@domain.com"
myMessage.Subject = "A prayer was sent"
myMessage.TextBody = strBody
myMessage.Fields.update
myMessage.Send
set myFields=nothing
set myMessage=nothing
set myConfig=nothing

Thanks in advance
</blockquote id="quote"></font id="quote">

glong
11-06-2003, 08:45 AM
if the to address is invalid, what kind of error msg I will get? How to handle this kind of error? I tried to send a email to invalid email address and the web page is very slow, then it says i need to change the timeout time. Any idea about this? thanks.