While migrating an application from an old IIS4(NT) server to a new win2003 machine there were some errors with emails.
It's always better to use a default component over a 3th party tool. That's why you should use CDO.
CDO (Collaboration Data Objects) is a Microsoft technology that is designed to simplify the creation of messaging applications.
However there are 2 versions of CDO: CDOSYS and CDONT.
Microsoft doesn't support CDONTs anymore on win2k/XP and 2k3.
So the only thing i had to change to make it work, was to change te version.
The code below works on windows 2003.
ASP:
-
<%
-
Set myMail=CreateObject("CDO.Message")
-
-
myMail.Subject="test"
-
myMail.From="name@domain.com"
-
myMail.To="name@domain.com"
-
myMail.TextBody="test"
-
-
myMail.Configuration.Fields.Item _
-
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
-
'Name or IP of remote SMTP server
-
myMail.Configuration.Fields.Item _
-
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
-
="relay1.smtp.local"
-
'Server port
-
myMail.Configuration.Fields.Item _
-
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
-
=25
-
myMail.Configuration.Fields.Update
-
-
myMail.Send
-
-
set myMail=nothing
-
response.write "mail send succesfully"
Popularity: 7% [?]
RSS feed for comments on this post · TrackBack URI
Leave a reply