cancel
Showing results for 
Search instead for 
Did you mean: 

How to send Notification mail (with attachement) from On-Demand job

Ckumar
Contributor
0 Kudos

Hi Experts,

I am using SAP IDM 7.2 SP8.

Requirement is to send a notification mail to a specific mail address abc@xyz.com whenever we run a on-demand job.

On-Demand job should also attach a csv file (atttachement.csv, which is in a specific folder D:\folder) while sending the notification mail.

Please help.

Thanks & Regards,

Chandan Kumar

Accepted Solutions (1)

Accepted Solutions (1)

jaisuryan
Active Contributor
0 Kudos

Hi Chandan,

Please check if the below post is of any help.

http://scn.sap.com/thread/3649167

Kind regards,

Jaisuryan

Answers (2)

Answers (2)

Ckumar
Contributor
0 Kudos

Thanks all

Now i am able to send attachment.

Inititally when i stored file path E:\TEST DRIVE\Attachment1.csv in a variable AttachmentPath, and passed this variable in uSendSMTPMessage function then it was throwing following error

ToGeneric.addEntry

org.mozilla.javascript.EvaluatorException: uSendSMTPMessage: Cannot read attached file.E:TEST DRIVEAttachment1.csv

Then I have stored file path as E:\\TEST DRIVE\\Attachment1.csv and notification mail is being sent with attachment.

Thanks & Regards,

C Kumar

jaisuryan
Active Contributor
0 Kudos

Hi Chandan,

Nice work, thanks for the correction. Please close the thread if feasible. Cheers.

Kind regards,

Jaisuryan

former_member2987
Active Contributor
0 Kudos

Hi there!

You'll need to write a quick script and reference the uSendSMTPMessage function.  You'll see that it supports attachments.

Regards,

Matt

Ckumar
Contributor
0 Kudos

Thanks for reply Matt

I have already written a job to sent notification mail and in that job i am using uSendSMTPMessage function.

IDM is successfully sending notification mail (without attachement).

Actually I want to know how to attach a attachment in this notification mail.

for example - attachment file is user.csv and its location is F:\usersdata

Could you please tell me how to attach this file in notification mail.

One more issue is that, notification mail is not showing mail meassage (although i am passing mail message in uSendSMTPMessage function) and its automatically attaching a .bin file in the mail sent.

Regards,

C Kumar

former_member2987
Active Contributor
0 Kudos

Hi there,

It sounds like you have the basics all together. I would check how you are setting the following parameters of uSendSMTPMessage:

Attachment

Optional. Fully qualified file name of a file to be included as an attachment.

Multiple attachments can be added by separating the file names by a pipe character (|).

AttachmentType

Optional. Valid MIME attachment type.

Charset

Optional. Valid ISO character set identifier, for instance ISO-2022-JP. The default value is ISO-8859-1.

HeaderEncoding

Optional. 0: Plain text, 1: Base64. Default: 0

TransferEncoding

Optional. 1: 7bit, 2: 8bit, 3: Quoted ASCII, 4: Base64. Default: 4.

Sorry the first row got mangled a bit. 

Matt

Ckumar
Contributor
0 Kudos

Hi matt,

This is exactly given in description of function uSendSMTPMessage.

I have no idea about how to pass the full qualified file name - Is i need to pass complete path of the file or i need to declare a local constant and store the full qualified file name in that and then pass that local constant in uSendSMTPMessage.

It will be really great if you can tell me how to attache following file in uSendSMTPMessage.


for example - attachment file is user.csv and its location is F:\usersdata

I am passing other values to function uSendSMTPMessage as

uSendSMTPMessage("sender@mycompany.com", "recipient@mycompany.com", "Test", "This message was sent from the Java runtime engine using SMTP", "mailserver.mycompany.com", Content,SMTP_PORT);

Please tell me how to add attachement in above function.

Thanks & Regards,

C Kumar

terovirta
Active Contributor
0 Kudos

Hello,

just pass the filename including path.

If you have working SMTP-connection, it takes few minutes to try out the answer Matt/Jai gave you.

Create a dummy test job and with toGeneric-pass and couple of lines of javascript is all you need.

regards, Tero