3w.ezer.com 9/2/2010 5:50:33 PM Learning Internet web w3 tutorials 3w.ezer.com:W3 ASP » email cdo.message:Learning asp sql html code in English

3w study

submit to 3000 search engines
You are reading :: English:: Learning ASP SQL VB HTML code

Learning .ASP SQL HTML XML CSS JAVA Perl code study
English Chinese_Traditional Chinese_Simplified

You are reading :: English English

Learning.Topic:
HOME
XML
VBscript
SQLserver
SQL
SearchEngine
Robots
php
Microsoft
JAVA
InternetProtocol
HTML
Ecommerce
CSS
ASP
. Active-Server-Flash
. Array
. Cache
. Connection
. Count
. Counter
. Distinct
. Email
»CDO.Message
»CDO.Message.error
»JMail.SMTPMail
»Persits.MailSender
»SMTPsvg.Mailer
. File
. Folder
. Function
. GetSQLserver
. Header
. mySQL
. Record
. Recordset
. Request
. Response
. Server
. server-createobject
. ServerVariables
. Session
. Special-Symbols
. String
. Sub
. Time

SiteMap

3w....Learning.tutorials > ASP > email » cdo.message

3w learning

email >
cdo.message

Title:

CDO : Set objMessage = CreateObject("CDO.Message") - old CDONTS : Set objMessage = Server.CreateObject("CDONTS.Message")


Description:

Set objMessage = Server.CreateObject("CDO.Message") sending TEXT : objMessage.TextBody sending HTML : objMessage.HTMLBody sending Attachment : objMessage.AddAttachment ------all email shall contain with an email@address----- objMessage.To = "to@---.com" objMessage.From = "from@---.com" objMessage.Bcc = "Bcc@---.com" objMessage.Cc = "Cc@---.com" ------------- objMessage.send ------------- you may have 2 or more objMessage.send objMessage2.send objMessage3.send in on script -------------------Server Address---------------- it is different with Server.CreateObject("JMail.SMTPMail") when use Server.CreateObject("CDO.Message") you do not list your Server Address in the script -------- How yahoo receive this kind of email----- yahoo treat this kind of auto send out letter as bulk email unless the address is listed on your address book ------------- Every email has an ID ------------- !!! Do not send junk emails !!! Each email has its own ID and mail server name... Your local server shall also receive each email ID


Example Code:

---- sending File : objMessage.AddAttachment ---- <% Dim objMessage Set objMessage = CreateObject("CDO.Message") objMessage.To = "to@---.com" objMessage.From = "from@---.com" objMessage.Bcc = "Bcc@---.com" objMessage.Cc = "Cc@---.com" objMessage.Subject = "Subject" objMessage.AddAttachment "c:\a-file.txt" objMessage.send 'free up the the computer memory Set objMessage = Nothing %> ----sending TEXT : objMessage.TextBody---- <% Dim objMessage Set objMessage = CreateObject("CDO.Message") objMessage.To = "to@---.com" objMessage.From = "from@---.com" objMessage.Bcc = "Bcc@---.com" objMessage.Cc = "Cc@---.com" objMessage.Subject = "Subject" objMessage.TextBody = "sending text only" objMessage.send 'free up the the computer memory Set objMessage = Nothing %> ----sending HTML : objMessage.HTMLBody---- <% Dim objMessage Set objMessage = CreateObject("CDO.Message") objMessage.To = "to@---.com" objMessage.From = "from@---.com" objMessage.Bcc = "Bcc@---.com" objMessage.Cc = "Cc@---.com" objMessage.Subject = "Subject" objMessage.HTMLBody="<b>CDO HTML mail example</b><br>" objMessage.HTMLBody=objMessage.HTMLBody&"a test html email" objMessage.HTMLBody=objMessage.HTMLBody&"<br>a line<hr>" objMessage.HTMLBody=objMessage.HTMLBody&"<br>Regards," objMessage.HTMLBody=objMessage.HTMLBody&"<br>Ezer" objMessage.send 'free up the the computer memory Set objMessage = Nothing %> -----------------err message code-------------- strErr = "" On Error Resume Next ' catch errors If Err <> 0 Then ' error occurred strErr = Err.Description response.write "CDO email error occurred : <br>" response.write "Error: "&strErr&"<br>"&vbcrlf else response.write "CDO email sent out with no error" End If -------------------------------------- CDONTS = C DON'T S , FOR old NT use so don't use it any more


Example Result:

TEXT :: sending text only HTML :: CDO HTML mail example
a test html email
a line



Regards,
Ezer


For the mail body info you may write like this way If you are writing a text form then just take off html tags. <% bodyinfo="Dear receiver,<br>" bodyinfo=bodyinfo&"It is nice to talk to you<br>" bodyinfo=bodyinfo&"May this method helps you.<p>" bodyinfo=bodyinfo&"Best Regards,<br>" bodyinfo=bodyinfo&"3w.ezer.com" objMessage.HTMLBody = bodyinfo %>


..
...
...

[ 9/2/2010 ]

Web Tools
Page rank checker
Table Builder
Meta Builder
Mask Maker

www learning school add more scripts and tips memo
You are at >>3W.EZER.COM >> 3W.EZER.COM/ASP/EMAIL/CDO.MESSAGE.ASP>>ASP
Helpful link:: SEO web tools :: Live PR | SERP checker Google SERP pageranking checker
back to top Ezer code adding :: Questions ;email