Sending e-mails using ASP and CDOSYS

Sending e-mails using ASP and CDOSYS - sample code:

<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->

Dim ObjectSendMail
Dim Conf
Dim Fields

Set ObjectSendMail = Server.CreateObject("CDO.Message")
Set Conf = Server.CreateObject("CDO.Configuration")

Set Fields = Conf.Fields
With Fields
.Item(cdoSendUsingMethod) = 2
.Item(cdoSMTPServer) = "localhost"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10


 = cdoBasic
.Item(cdoSendUserName) = "USERACCOUNT"
.Item(cdoSendPassword) = "PASSWORD"
End With

Set ObjectSendMail.Configuration = Conf

Set ObjectSendMail.Configuration = Conf
ObjectSendMail.Subject = "My message subject"
ObjectSendMail.From = ""
ObjectSendMail.To = ";"

ObjectSendMail.TextBody = "This is a plain text email"


Set ObjectSendMail = Nothing
Set Conf = Nothing
Set Fields = Nothing

Was this answer helpful?

 Print this Article

Also Read

Sending mail using CDO

Sending mail using CDO Please check the following article for more information on...

Is there a limit to the number of email I can send using your SMTP?

Yes, there is a limit on the number of mail you can send from our server using email service....

How do I set up my e-mail in Eudora 5.2?

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal...

What is the difference between using IMAP or POP for my mail?

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal...

Does my mailbox have any limits on it?

Web Sanchar India does not impose a quota limitation on your email boxes...