Sending Mail using CDOSYS in ASP

To send mail from a website we can use CDOSYS. In old version WindowsNT server CDONTS was available but now in Windows hosting servers we have to use CDOSYS. Here is a simple code to send mail from website.

<%
Set plusMail=CreateObject("CDO.Message")
plusMail.Subject="Mail from Windows server using ASP script by with CDO"
plusMail.From="test@sitename.net"
plusMail.To="userid@sitename.com"
plusMail.Bcc="somename@sitename.com"
plusMail.CC="someone@sitename.com"
plusMail.TextBody="This is the text body of the mail"
plusMail.Send
set plusMail=nothing
%>

We can add CC & BCC to it like this.

<%
Set plusMail=CreateObject("CDO.Message")
plusMail.Subject="Mail from Windows server using ASP script by with CDO"
plusMail.From="test@sitename.net"
plusMail.To="userid@sitename.com"
plusMail.Bcc="somename@sitename.com"
plusMail.CC="someone@sitename.com"
plusMail.TextBody="This is the text body of the mail"
plusMail.Send
set plusMail=nothing
%>

To send HTML mail we can configure like this.

<% Set plusMail=CreateObject("CDO.Message")
plusMail.Subject="Mail from Windows server using ASP script by with CDO"
plusMail.From="test@sitename.net"
plusMail.To="userid@sitename.com"
plusMail.HtmlBody="<h1>Welcome to Plus2net.net</h1><br>This is normal line<br><h2>This is h2 line</h2>"
plusMail.Send
set plusMail=nothing
%>


Be the first to post comment on this article :

plus2net.com




Post your comments , suggestion , error , requirements etc here .




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer