نمونه کد ASP برای ارسال ایمیل از طریق CDO همراه با Authentication

Dim objMail

 

set objMail = Server.CreateObject("CDO.Message")

objMail.From = "youraccount@yourdomain.com "

objMail.Subject = "CDOSYS Mail Message "

objMail.To = "youraccount@yourdomain.com "

objMail.TextBody = "Hello World"

objMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing")=2

'Name or IP of remote SMTP server

objMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") _

="mail.yourdomain.com"

'Server port

objMail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _

=2525

objMail.Configuration.Fields.Update

 

objMail.Send

set objMail = nothing

Add Feedback