On Windows server, you can send mail using CDO. CDO allows to send email using SMTP authentication as well as without SMTP authentication.
Here is the sample code to send email using SMTP authentication using CDO:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
<% Set objEmail = CreateObject("CDO.Message") objEmail.From = "youremail@domain.com" objEmail.To = "someone@domain.com" objEmail.Subject = "Test Mail" objEmail.Textbody = "Test Mail" objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP SERVER NAME" objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1" objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "youremail@domain.com" objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "Email_Account_Password" objEmail.Configuration.Fields.Update objEmail.Send If Not err.number=0 Then Response.write "ERROR: " & err.Description err.Clear Else Response.write "Email sent to " & objEmail.To end if %> |
You will have to update SMTP server, SMTP username and password in the above sample script.