on 10-01-2013 7:46 AM
Dear All,
I am aware function smtp_to and email_to .
But want to know from where we can call these functions in SAP BODS.
Please let me know how to enable email sending from SAP BODS .
As Ken, said, these are done using the Script. Scripts can be added to in various places in a Job (i.e. Job, Workflow, Catch, Conditional, While Loop, etc.). It can also be added to any custom functions you want to create. The syntax is pretty straight forward for both:
smtp_to('someone@somewhere.com', 'Mail Example', 'This is an example of sending email.', 0, 0);
mail_to('someone@someplace.com', 'Mail Example', 'This is an example of sending email.', 0, 0);
The key here, is while this is all you need in a job to send a message, you need to the Job Servers to be configured for mail. This is done by who ever is managing your Job Servers.
This is done in the Data Services Server Manager. The SMTP settings for smtp_to function are on the Miscellaneous tab. There you specify the Server & Sender.
If you don't have access to that, there are other ways to send email. If a database you are using (like SQL Server for example) has mail capabilities you can utilize that in the same way you would send email in a query. We have at times done this as we needed to send datasets in the email and it worked out as SQL Server allows you to send query results as part of the email (whereas the smtp_to function doesn't do that).
Hope that adds to what Ken also stated.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
These functions can genuinely be called only in a script and are typically used in the catch block of a job to report errors. The Data Services Reference Guide can give you more specifics but you must have a mail client running on the data services job server to use mail_to. When using either you will want to make sure the servers are not blocked from sending emails (like in dev or QA environments).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In your catch block you would mark the exceptions for which you want emails. These are categorized like Execution errors, database access errors, etc.
The script in your catch block would look something like this...
smtp_to('someone@somewhere.com,someoneelse@somewhereelse.com',
'Data Service error number: '||error_number(),
'Error Message: '||error_message(),20,40);
The email will only be generated if the job fails with one of the categories of errors you selected.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.