classic asp - cdonts
To send mail using Classic ASP script you will need to use the built-in email function called CDONTS or CDOSYS. CDOSYS is the recommended way to send email ...
I'm trying to send an email using classic asp and cdonts on a Windows Server 2003 machine.
But I'm guessing the SMTP service needs to be running. Unfortunately it's asking for teh SP1 disk...which apparently has gone missing. I'm guessing not but is there any other way of doing this?
Conversion from CDONTS to CDOSYS (Microsoft does not support CDONTS)
Switching from CDONTS to CDOSYS couldn't be easier. The following is an example of an ASP script used to send email with CDONTS. Note, that this code is using variables called strTo, strFrom, strSubject and strBody that have either been set previously or posted to this page using a form.
<% Set oMail = CreateObject("CDONTS.NewMail")
oMail.BodyFormat = 0
oMail.MailFormat = 0
oMail.Importance = 2
oMail.to = strTo
oMail.From = strFrom
oMail.Subject = strSubject
oMail.Body = strBody
Set oMail = Nothing
Using CDOSYS we can accomplish the same thing. There is more to CDOSYS than this, but the example shown below should be enough to generate simple email messages. If you need to include HTML tags in your email message, you must use cdoMessage.HTMLBody instead of cdoMessage.TextBody. Note, this script has simple string text directly in code. It is likely you would replace the text with a string variable. See above example.
myMail.Subject="This is an email"
Click Here to Visit