0

Here is my Complete code. There is no other code in the entire page.

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="abcd@example.com"
myMail.To="abc@example.com"
myMail.TextBody="This is a message. "
Response.write "Execution Reached Before Send!"
myMail.Send
Response.write "Execution Reached After Send!"
set myMail=nothing

When I run this asp page, the result I am getting is "Execution Reached Before Send!". There is no other error messages. All I can understand from this is anything after the myMail.Send is not being executed and I am not receiving any emails also.

I am using Windows Server 2008 R2 Standard (Service Pack 1). SMTP mail server is installed on the local machine. I created a test email and dropped in "C:\inetpub\mailroot\Pickup" folder and it worked perfectly.

Taylan Aydinli
  • 4,333
  • 15
  • 39
  • 33
Cherian M Paul
  • 646
  • 4
  • 11
  • The code worked after I added these four lines before the send. myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 myMail.Configuration.Fields.Update – Cherian M Paul Aug 14 '13 at 15:22
  • 1
    Please add your comment as an answer. (Or delete the question itself, if you don't believe it has an value.) – John Parker Aug 14 '13 at 15:35
  • It won't let me add as answer. Its says, I have to wait for 8 hours before I can answer my own queston. – Cherian M Paul Aug 14 '13 at 15:40
  • In that case, check back tomorrow. :-) – John Parker Aug 14 '13 at 15:40

1 Answers1

0

The code worked after I added these four lines before the send.

myMail.Configuration.Fields.Item ("schemas.microsoft.com/cdo/configuration/sendusing") = 2
myMail.Configuration.Fields.Item ("schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost" 
myMail.Configuration.Fields.Item ("schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
myMail.Configuration.Fields.Update 
Cherian M Paul
  • 646
  • 4
  • 11