[thelist] CDONTS Mail Problem

Jay Blanchard jay.blanchard at niicommunications.com
Tue Apr 2 14:18:00 CST 2002


I have a friend that gave me this and said that it would not work.

<%
set oMail = Server.CreateObject ( "CDONTS.NewMail" )
Dim strTo
Dim strFrom
Dim strSubject
Dim strBody

strTo = "webmaster at whereever.com"
strFrom = "test"
strSubject = "This is an email subject"
strBody = "Thanks for reading this message. But I must admint. I lied.
There's nothing " & _
  "important about this message at all."

oMail.Send strFrom, strTo, strSubject, strBody
set oMail = nothing
oMail.Close()
%>

It's been a while since I have dealt with CDONTS mail in ASP, but I knew
that you gurus out there could help him. I did tell him that he needed to do
the following;

<%
set oMail = Server.CreateObject ( "CDONTS.NewMail" )
oMail.To = "webmaster at whereever.com"
oMail.From = "test at whereever.com"
oMail.Subject = "This is an email subject"
oMail.Body = "Thanks for reading this message. But I must admint. I lied.
There's nothing " & _
  "important about this message at all."

oMail.Send
set oMail = nothing
oMail.Close()
%>

Or that he could use the variables as follows;
<%
set oMail = Server.CreateObject ( "CDONTS.NewMail" )
oMail.To = strTo
oMail.From = strFrom
oMail.Subject = strSubject
oMail.Body = strBody

oMail.Send
set oMail = nothing
%>

Is there anything else missing?

TIA!

Jay





More information about the thelist mailing list