Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Can't send mail to the same domain.


Message #1 by damjan.luc@t... on Fri, 23 Nov 2001 08:57:42

  Hello everyone. I am having troubles with CDONTS. When i try to send 

mail to the same domain, the receiver doesn't receives that mail, but the 

sender gets the administrator notification, tha the message cannot be 

delivered. But when I send mail to the another domain it works fine. If I 

send mail to the same recipient from outlook he receives it.



  The script runs on IIS4.0 and WinNT4.0 with Exchange5.5.



  Source:



<%@ LANGUAGE = "VBScript" %>



<% 

Set objNewMail = Server.CreateObject ("CDONTS.NewMail") 

objNewMail.To = "webmaster@t..."

obj.NewMail.From = "damjan.luc@t..."

obj.Subject = "Test."

obj.Body = "Test."

objNewMail.Send

Set objNewMail = Nothing

Response.Write "Message was sent"

%>





  Thanks

  Damjan.

Message #2 by damjan.luc@t... on Mon, 26 Nov 2001 07:41:53

  Hello.



  Solved my own problem with the folowing script:



<% 

'Simple example that shows how to send a message from a Web browser. 



Set objOMSession = Server.CreateObject("MAPI.Session")



bstrProfileInfo = "timnts" & chr(10) & "Web"



'                   ^^ Exchange Server  ^^User to logon as



'Log on to the Exchange Server.



objOMSession.Logon "", "", False, True, 0, True, bstrProfileInfo 



'Add a message to the Outbox.



Set objmessage = objOMSession.Outbox.Messages.Add



'Create a recipient object for that message.



Set objonerecip = objmessage.Recipients.Add



'Assign an e-mail address to mail to for that recipient object.



objonerecip.Name = "damjan.luc@t..."

'Try to resolve the recipient?s name as a valid e-mail address.



objonerecip.Resolve



'Create the subject for the message.



objmessage.Subject = "This is Subject"



'Add the text for the message body.



objmessage.Text = "Active body text."



'Send the message without showing a dialog to the user.



objmessage.Send showDialog=False



%>



Message Sent.





  Hope this will help someone with the same problems,



  Damjan.


  Return to Index