VBSCript to Send mail using CDO with Delivery and Read Recipient enabled

Below is the Procedure to send mail using CDO with Delivery and Read Recipient Enabled
Sub TestmailusingCDO_SMTP()
set objMsg = CreateObject(“CDO.Message”)
set objConf = CreateObject(“CDO.Configuration”)
Set objFlds = objConf.Fields
 
 With objFlds
  .Item(“http://schemas.microsoft.com/cdo/configuration/sendusing“) = 2
  .Item(“http://schemas.microsoft.com/cdo/configuration/smtpserver“) = “SMTPServername”
  .Update ‘ Save
 End With

strBody = “This is a Test email.” & vbCRLF & vbCRLF & “—————————”

 With objMsg
  Set .Configuration = objConf
  .To = “<valid email addres>”
  .From = “<valid email addres>”
  .Subject = “Testing Email ” & Date()
  .TextBody = strBody ‘ Use .HTMLBody to send a HTML e-mail
  .Fields(“urn:schemas:mailheader:disposition-notification-to”) = “<valid email addres>”
  .Fields(“urn:schemas:mailheader:return-receipt-to”) = “<valid email addres>”
  .DSNOptions = cdoDSNSuccessFailOrDelay
  .Fields.update ‘ Save
  .Send
 End With

 

End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s