on 09-29-2016 2:02 PM
Hi All,
When I used below script to sent a mail successfully,
smtp_to('abc@gmail.com','Subject','Message',0,5);
Then how to send mail with attachment file.
when i tried below scn link,
Please share needful information.
Thanks,
Chandra. K
hi Chandra,
Use VBScript method. We implemented in the same way.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
When my process as below:
Step 1: Configure SMTP Server
Step 2: save .vbs file in E:/ drive in shared folder.
In vbs scripts as below,
strSMTPFrom = "abc@gmail.com"
strSMTPTo = "cdf@gnail.com"
strSMTPRelay = "smtp server name given"
strTextBody = "JOB_NAME completed successfully in UAT. Attached is the file load status."
strSubject = "JOB_NAME completed in UAT"
strAttachment = "\\E:\Demo\Status_File.csv"
Set oMessage = CreateObject("CDO.Message")
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPRelay
oMessage.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
oMessage.Configuration.Fields.Update
oMessage.Subject = strSubject
oMessage.From = strSMTPFrom
oMessage.To = strSMTPTo
oMessage.TextBody = strTextBody
oMessage.AddAttachment strAttachment
oMessage.Send
and
Script written as below,
exec('CScript','[$G_PROCESSED_LOCATION]\email.vbs',8);
here [$G_PROCESSED_LOCATION] = '\\E:\Demo\' with data type varchar(255)
When i execute job in Administrator login also not send mail.
Please share needful information.
Thanks,
Chandra. K
Hi Chandra,
if you see the log "Network Path was not found".. this issue might me with the some connection/configurations or might be in the script.
Also check if you have given all the required parameters in the below script
strSMTPFrom = <<Server from which mail alert will be sent>>
strSMTPTo = <<To_list to whom mail needs to be sent>> #We can have substitution parameter define with list of E-mail ids to which this to be sent
strSMTPRelay = <<SMTP Relay mail>> #like the domain from which mails will be sent
strTextBody = <<E-mail BODY>
strSubject = <<E-mail Subject>
StrAttachment = <<Specify the shared drive path from where file to be attached is present>> eg: D:\Kshop\Sample\Rejected
Set oMessage = CreateObject("CDO.Message")
Hi Ravi,
Thanks for quick response,
When I wrote script as below,
strSMTPFrom ="siva.kumar@gmail.com" #here mail also define at data service servermanager <<Server from which mail alert will be sent>>
strSMTPTo = "chadnrasekhar@gmail.com" ##Target file sending mail
<<To_list to whom mail needs to be sent>>
#We can have substitution parameter define with list of E-mail ids to which this to be sent
strSMTPRelay = "smtp.ourcompany.com" ##define smtp server name<<SMTP Relay mail>> #like the domain from which mails will be sent
strTextBody = ""Job success"<<E-mail BODY>
strSubject = "Message"<<E-mail Subject>
StrAttachment ="\\E:\Demo\Status_File.csv" #target file path
<<Specify the shared drive path from where file to be attached is present>> eg: D:\Kshop\Sample\Rejected
Set oMessage = CreateObject("CDO.Message")
print(exec('cscript','[$G_PROCESSED_LOCATION]\\email.vbs',8));
here [$G_PROCESSED_LOCATION] = '\\\E:\Demo' data type varchar(222)
and Job server details as shown below,
Thanks,
Chandra. K
You may use 3rd-party SMTP client supporting attachments, instead of default one.
You would need to amend DSConfig.txt file accordingly.
Thank you,
Viacheslav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.