web 2.0

How to use ASP & Sending Mail with CDO.Message (Using SMTP Server)

How to use ASP & Sending Mail with CDO.Message (Using SMTP Server) This is learn/tutorial asp developers how to using ASP script Sending Mail with CDO.Message (Using SMTP Server)

ShotDev Focus:
- ASP & Sending Mail with CDO.Message (Using SMTP Server)

Example

asp_cdomessage_smtp.asp


<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
Dim myMail,HTML,strMsg

Set myMail = Server.CreateObject("CDO.Message")

Dim cdoConfig
Set cdoConfig = myMail.Configuration
With cdoConfig.Fields
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

myMail.Configuration = cdoConfig

strMsg = ""
strMsg = strMsg &"<h1>My Message</h1><br>"
strMsg = strMsg &"<table width='285' border='1'>"
strMsg = strMsg &"  <tr>"
strMsg = strMsg &"    <td><div align='center'><strong>My Message </strong></div></td>"
strMsg = strMsg &"    <td><div align='center'><font color='red'>My Message</font></div></td>"
strMsg = strMsg &"    <td><div align='center'><font size='2'>My Message</font></div></td>"
strMsg = strMsg &"  </tr>"
strMsg = strMsg &"  <tr>"
strMsg = strMsg &"    <td><div align='center'>My Message</div></td>"
strMsg = strMsg &"    <td><div align='center'>My Message</div></td>"
strMsg = strMsg &"    <td><div align='center'>My Message</div></td>"
strMsg = strMsg &"  </tr>"
strMsg = strMsg &"  <tr>"
strMsg = strMsg &"    <td><div align='center'>My Message</div></td>"
strMsg = strMsg &"    <td><div align='center'>My Message</div></td>"
strMsg = strMsg &"    <td><div align='center'>My Message</div></td>"
strMsg = strMsg &"  </tr>"
strMsg = strMsg &"</table>"

myMail.From = "webmaster@shotdev.com"
myMail.To   = "member@shotdev.com"
myMail.Subject = "My Subject"
myMail.HTMLBody = strMsg

myMail.Send
Response.write ("Mail Sending.")
Set myMail = Nothing
%>
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_cdomessage_smtp.asp

Screenshot

ASP & Sending Mail with CDO.Message (Using SMTP Server)
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

One Response to “How to use ASP & Sending Mail with CDO.Message (Using SMTP Server)”

  1. 1masters…

Leave a Reply

You must be logged in to post a comment.