Académique Documents
Professionnel Documents
Culture Documents
HowtosendHTMLformattedmailusingCDOforWindows2000andaremoteSMTPservice
Support
Summary
This article describes how to send HTML formatted mail using CDO for Windows 2000 CDOSYS
or CDO for Exchange 2000 CDOEX using a remote computer's SMTP service.
More information
1. Create a file called Cdosmtp.vbs and paste the following code:
'Sendbyconnectingtoport25oftheSMTPserver.
DimiMsg
DimiConf
DimFlds
https://support.microsoft.com/enus/kb/286431
1/4
31/7/2015
HowtosendHTMLformattedmailusingCDOforWindows2000andaremoteSMTPservice
DimstrHTML
ConstcdoSendUsingPort=2
setiMsg=CreateObject("CDO.Message")
setiConf=CreateObject("CDO.Configuration")
SetFlds=iConf.Fields
'SettheCDOSYSconfigurationfieldstouseport25ontheSMTPse
rver.
WithFlds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusin
g")=cdoSendUsingPort
'ToDo:EnternameorIPaddressofremoteSMTPserver.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserve
r")="<remoteSMTPserver>"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconne
ctiontimeout")=10
.Update
EndWith
'BuildHTMLformessagebody.
strHTML="<HTML>"
strHTML=strHTML&"<HEAD>"
strHTML=strHTML&"<BODY>"
strHTML=strHTML&"<b>ThisisthetestHTMLmessagebody</b></b
r>"
strHTML=strHTML&"</BODY>"
strHTML=strHTML&"</HTML>"
'Applythesettingstothemessage.
WithiMsg
Set.Configuration=iConf
.To="<emailaddress>"'ToDo:Enteravalidemailaddress.
.From="<emailaddress>"'ToDo:Enteravalidemailaddress.
.Subject="ThisisatestCDOSYSmessage(SentviaPort25)"
.HTMLBody=strHTML
.Send
EndWith
'Cleanupvariables.
SetiMsg=Nothing
SetiConf=Nothing
SetFlds=Nothing
MsgBox"MailSent!"
https://support.microsoft.com/enus/kb/286431
2/4
31/7/2015
HowtosendHTMLformattedmailusingCDOforWindows2000andaremoteSMTPservice
References
For additional information, click the article number below to view the article in the Microsoft
Knowledge Base:
286430 How To Send HTML Formatted mail Using CDO for Windows 2000 and the Local
Pickup Directory
Properties
Article ID: 286431 Last Review: 06/19/2014 12:38:00 Revision: 4.0
Keywords:
kbhowto KB286431
Support
Security
Contact Us
https://support.microsoft.com/enus/kb/286431
3/4
31/7/2015
HowtosendHTMLformattedmailusingCDOforWindows2000andaremoteSMTPservice
Terms of use
https://support.microsoft.com/enus/kb/286431
Trademarks
2015 Microsoft
4/4