Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Triggering email without going through SAP queue

Former Member
0 Kudos
2,517

Hi All,

When we are triggering email by ABAP using FM such as "SO_DOCUMENT_SEND_API1" or using certion class concept, the mail goes through SAP queue i.e SOST or SO01.

My requirement is, the mail should go directly to the email id provided without going through SAP queue i.e by passing the queue.

I have looked in SCN but couldnot able to get any relevent suggestion.

Please guide.

Thanks.

Regards,

Munu

20 REPLIES 20

rosenberg_eitan
Active Contributor
0 Kudos
1,217

Hi,

What is the problem with using SAP built in and PAID for facility to send mail ?

In SCOT we can put any SMTP server that will do the actual connection to the ourside world .

Some time for testing I use minimalist mail server on my PC .

Regards.

rosenberg_eitan
Active Contributor
0 Kudos
1,217

Hi,

Forgot to mention:

Try using cl_bcs

See programs BCS_EXAMPLE* .

Send email from ABAP with class CL_BCS - Code Gallery - SCN Wiki

Regards.

0 Kudos
1,217

Thanks Eitan,

the link you provided is really useful of knowing another way of sending mails.

but the mail waits in the SAP connect queue i.e Tcode SOST.

My requirement is to send the mail directly to the email id by-passing the queue.

Please suggest.


matt
Active Contributor
0 Kudos
1,217

I am not aware of any way other than SOST/SCOT/SO01.

Why do you have this requirement? What is the business need?

DominikKraemer
Active Participant
0 Kudos
1,217

If you use class cl_bcs you can use method set_send_immediately so that the item at least does not wait until the job picks it up from SOST. Maybe this is already enough?

rosenberg_eitan
Active Contributor
0 Kudos
1,217

Hi,

If you really really really need this kind of mail support then search for:

"command line tools to send email" or write one yourself.

Then you can create a file and execute an external command to send it.

See Transaction SM69 and FUNCTION 'SXPG_COMMAND_EXECUTE'

But again I would not recommend this (Waste of money & time)

Regards.

JuanCarlosDelga
Contributor
0 Kudos
1,217

Hi Munu,

At least there is other way to send and email without  using SOST, you can create and email using OLE objects, but this option needs to have installed locally Microsoft Outlook as email client.

I only can see one advantage, if you have to use a corporate template that already works with Outlook.

Regards

JCD

0 Kudos
1,217

You could write an SOA application that sends emails directly, and communicate with that. So many ways! But what's wrong with the one supplied by SAP?

Colleen
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,217

Hi Matt

Curious question here from a non-ABAP... If you don't go through SAP's way (SOST/SCOT) would you have risk on not having a central place to switch off sending of emails?

Depending on how custom solution is implemented I could see Non-Prod accidentally sending production-like emails, etc. Or is a check you would include in your code to control this risk?

Regards

Colleen

0 Kudos
1,217

Even using SAP standard, this is a risk. Usually there's code "If not P then say "THIS IS NOT REAL!". And of course, you properly manage the recipients so end users don't get anything from test or dev.

0 Kudos
1,217


Hi Juan,

Can you please provide how can we proceed by OLE objects?

Thanks for your suggestion.

Regards,

Munu

0 Kudos
1,217

Hi Matthew,

Actually my requirement is that when an user het critical profile in SU01 then while saving the user a mail should trigger to certain email id.

So, if we use  FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' or class CL_BCS. The mail will halt at sost/so01 in development/quality system.

The user who gave the critical profile, can easily delete the mail from Sost/so01. Hence the mail not not be going to the recipient. So my requirement is to by-pass the mail from SOST/SO01.

Hope my requiremrnt is clear.

Please suggest any way to tackle this.

Regards,

Munu


0 Kudos
1,217

Hi,

So why not immediately submit report RSCONN01 after your email.

Kind regards, Rob Dielemans

0 Kudos
1,217

Or remove access to SO01.

0 Kudos
1,217

Hi Matthew,

Thnaks for ur help.

But we can't do so as other consultants will be using for their purpose as well.

Any other way to triffer the mail.

Regards,

Munu


0 Kudos
1,217

Hi Munu,

There are several example in yhis forum.

http://scn.sap.com/message/5099224#5099224

Mail sending Using ABAP OLE in LOTUS Notes

Regards.

JCD

0 Kudos
1,217

Hi Munu,

You can CL_BCS classes to send email.

However if you want to send it immediately to the recipient you can schedule job 'RSCONN01' for every I minute or whatever time frame you want so that it will fetch all the mail waiting for send status and send it to the recipient. You can consult with the basis person for the same.

Santosh

0 Kudos
1,217


Hi Santosh,

we can use RSCONN01 program sending the mail from the queue.

But it will release all the mails in the queue.

I only need the mails that my program generate should be send.

Please guide

Regards,

Munu

0 Kudos
1,217

Hello,

again why not use class cl_bcs with method set_send_immediately. The email is then released directly from the queue without affecting the others in the queue.

Regards,

Dominik

FredericGirod
Active Contributor
0 Kudos
1,217

Hi,

if you are under Unix (linux) system, you could create a command line and used this command line to send the mail.  looks like :

mail -s "Title" email@myaddress.net < file

I'm not sure you could specify the sender, if not the sender will be the username which SAP is running

regards

Fred