Mail with attachement
Mail with attachement
I am on ControlM 6.2.01 on Windows and I need to know if it is possible to send an email with attachement?
- rahulsehgal
- Nouveau
- Posts: 148
- Joined: 19 Mar 2009 12:00
- Location: Delhi
- Contact:
- rahulsehgal
- Nouveau
- Posts: 148
- Joined: 19 Mar 2009 12:00
- Location: Delhi
- Contact:
- philmalmaison
- Nouveau
- Posts: 1148
- Joined: 08 Jun 2007 12:00
- Location: Ile de France
VBS script for sending mails
HI
You can use the below code in a VBS script ,just fill in with your requirment.
----------------------------------------
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "Mail of sender"
objEmail.To = "Recipient"
objEmail.Cc = ""
objEmail.Subject = "Your subject"
objEmail.Textbody = "text body without pressing an enter"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/config ... /sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/config ... smtpserver") = "SMTP IP"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/config ... serverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
You can use the below code in a VBS script ,just fill in with your requirment.
----------------------------------------
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "Mail of sender"
objEmail.To = "Recipient"
objEmail.Cc = ""
objEmail.Subject = "Your subject"
objEmail.Textbody = "text body without pressing an enter"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/config ... /sendusing") = 2
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/config ... smtpserver") = "SMTP IP"
objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/config ... serverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
Confirm: use a blat.exe utility.
You can create a single script that send e-mails with or without attachment.
For example I use this method for:
- send "normal" e-mail but with group of "To" and "cc" e-mails addresses, saved on test files (centralize the administration: add,modify and remove addresses). Normal e-mails whith variables also in the subject (not possible in controlM)
- send e-mails with attached the sysout of execution (in 6.2 were not possible)
- send e-mails with attached others files (output, logs, other)
- send e-mails with compressed (zip) attached files:
- sysouts very large (in case of notok often happens)
- large files output
- many files to attach
All these options are configured in the script that use blat, passing the right parameters.
Note: i use this program also in step panel using the "shout" option....
....and more !
You can create a single script that send e-mails with or without attachment.
For example I use this method for:
- send "normal" e-mail but with group of "To" and "cc" e-mails addresses, saved on test files (centralize the administration: add,modify and remove addresses). Normal e-mails whith variables also in the subject (not possible in controlM)
- send e-mails with attached the sysout of execution (in 6.2 were not possible)
- send e-mails with attached others files (output, logs, other)
- send e-mails with compressed (zip) attached files:
- sysouts very large (in case of notok often happens)
- large files output
- many files to attach
All these options are configured in the script that use blat, passing the right parameters.
Note: i use this program also in step panel using the "shout" option....
....and more !