Only a few lines of code make you able to use the CDO object and mail wherever you like through SMT
Only a few lines of code make you able to use the CDO object and mail wherever you like through SMTP, in HTML or plain Text. You can also send
API Declarations
'Microsoft CD 1.21 Library' or higher
Rate Only a few lines of code make you able to use the CDO object and mail wherever you like through SMT
(1(1 Vote))
Dim strSubject, strTxtBody, strTo, strCC, strBCC, strAttachFile
Dim MailServer, MailPort
MailServer = "MAILSERVER"
MailPort = 25 '...probably
strAttachFile = "c:\Attach.pdf" 'you can comment out the "AddAttachment
strSubject = "Subject" 'if you dont wish to use
strTxtBody = "Body"
strTo = "[email protected];[email protected]"
Set objCDO = CreateObject("CDO.Message")
Set objCDOConfig = CreateObject("CDO.Configuration")
Set objFields = objCDOConfig.Fields
With objFields
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = MailServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = MailPort
.Item("http://schemas.microsoft.com/cdo/configuration/SendUsing") = 2
.Update
End With
With objCDO
.Configuration = objCDOConfig
.To = strTo
.CC = strCC
.BCC = strBCC
.From = "[email protected]"
.Subject = strSubject
.HTMLBody = strTxtBody
'.AddAttachment (strAttachFile)
.Send
End With
Set objFields = Nothing
Set objCDOConfig = Nothing
Set objCDO = Nothing
End Sub
Only a few lines of code make you able to use the CDO object and mail wherever you like through SMT Comments
No comments yet — be the first to post one!
Post a Comment