cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching files through smtp_to / mail_to functions.

Former Member
0 Kudos

Hi All,

Can Data Services ( any version of SAP BODS) provides a facility to send files (output file/log files) as email attachment through SMTP services ?

 

Now we can only provide specific number of lines in log files which will come as message body.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi, Rahul.

Actually you can use the native DS mailer.exe application to accomplish this task. I have been testing this few months ago using the MS Outlook mail client.

In order to do that you'll need Outlook and an antivirus installed in the Job Server machine. Outlook won't allow a third party application to send emails through its client if a valid antivirus is not found.

1. Configure the Server and the Sender in the DS Server Manager.

2. In Outlook (2007/2010), click File > Options > Trust Center (left panel) > Trust Center Settings... > Programmatic Access (left panel) and select "Never warn me about suspicious activity". This will allow DS to send emails through the Outlook client. If your antivirus is supported by Microsoft, you will see "Antivirus status: Valid" on this screen.

You should now be able to send emails with attachments using the following command within a script in your job:

exec('cmd','mailer -fsender@ yourcompany.com -trecipient@ othercompany.com -sEmailSubject -mC:\temp\emailbody.txt -aC:\temp\CompanyResults.zip',8);

Where:

-f defines the sender configured in the Server Manager.

-t defines the recipient (or recipients list separated by commas).

-s defines the subject of the email. A variable can be used to pass a list of recipients (separated by commas).

-m defines a file which contains the body of the email.

-a defines a file to be attached to the email.

I hope it helps you.

Regards,

Leo.

Former Member
0 Kudos

Use the email adapter available from versions 11.5. Check this link.

http://wiki.sdn.sap.com/wiki/display/EIM/Example+II+-+the+eMail+Adapter

Arun

Former Member
0 Kudos

You can achieve this by a 3rd party utility like Bmail and mpack.

See also this KB 1588974 - smtp_mailer.exe does not send attachments - Data Services XI 3.X

https://bosap-support.wdf.sap.corp/sap/support/notes/1588974

Thanks

Nawfal

Former Member
0 Kudos

Hi Nawfal,

The link that you have provided above, we are unable to access it. Can you please provide some other link or information about the above context ?

Former Member
0 Kudos

Hi,

Basically instead of using the SMTP_TO  function, you can use instead the exec command to call another SMTP mail sender to send attachments.

This is the content of the KB:

Symptom

A script using an exec command to call smtp_mailer.exe in Data Services designer fails to send attachments as part of the email notification.
The email notification is received ok but the file specified as attachment is missing.


Environment

Data Services XI 3.x
Any supported OS
smtp_mailer.exe found in %LINK_DIR%\bin


Reproducing the Issue

In Data Services designer create a sample job.
Add a script like this:
exec('C:\PROGRA~1\BUSINE~1\BUSINE~1\bin\smtp_mailer.exe'-r"<Mail server>" -f"<Mail from>" -t"<Recipients>" -s"<Subject of Mail>" -m"<File name>" -v,0);

Cause

smtp_mailer.exe does not support sending attachments.

Resolution

This can be achieved by using  other 3rd party utilities  instead of smtp_mailer.
Bmail and mpack are examples of Command Line SMTP Mailer for Batch Jobs  that  would send email attachments.
Refer to this site (http://retired.beyondlogic.org/solutions/cmdlinemail/cmdlinemail.htm) for download and how to.

Former Member
0 Kudos

Hi Rahul

I am not sure But if your backend Database has the function or stored procedure to send e-mails with attachments, You can use those stored proc. in BODS.