Solved How can i add include CC, BCC portion?

May 17, 2013 at 10:04:02
Specs: Windows 7
How can i add include CC, BCC portion in the below code .

SMTPServer = "mail.uhc.com"
Recipient = "suhail_abbas@uhc.com"
From = "suhail_abbas@uhc.com"
Subject = "Test email"
Message = "THE EMAIL SUBJECT"
'attachment = "C:\Users\211364\Desktop\TWS\TWS jobs info.txt"

'If there is no attachment needed,Remove or comment above line.
'To comment the line,just add " ' " before the line.
'DO not modify anything below this line.

GenericSendmail SMTPserver, From, Recipient, Subject, Message

Sub GenericSendmail (SMTPserver, From, Recipient, Subject, Message)

set msg = WScript.CreateObject("CDO.Message")
msg.From = From
msg.To = Recipient
msg.Subject = Subject
msg.TextBody = Message
'msg.AddAttachment attachment
msg.Configuration.Fields ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
msg.Configuration.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
msg.Configuration.Fields.Update
msg.Send
End Sub


See More: How can i add include CC, BCC portion?

Report •

#1
May 17, 2013 at 13:16:08
✔ Best Answer
msg.Bcc = "you@your.com"
msg.Cc = "you2@your.com"
msg.Send

:: mike


Report •

#2
May 28, 2013 at 10:54:32
Thanks Mike...

I have one more question.

I want to pass argument form the batch script to the above Message = "THE EMAIL SUBJECT"
I want to pass body of the mail from as argument from the batch file.
The requirement is it has to check for a file daily in the path . if the file is "Change file"
THe body of the mail should be like "Change file is submitted"
If the file is "Full file" avaible in the same path
The body of the mail should be like "Full file is submitted".

Im trying to capture this information by declaring variable and then passing this variable as argument to vbs script.
Please help me how could i handle this?


Report •
Related Solutions


Ask Question