2014 Nov 04 6:32 AM
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
2014 Nov 04 6:57 AM
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.
2014 Nov 04 7:05 AM
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.
2014 Nov 06 2:31 PM
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.
2014 Nov 04 7:18 AM
I am not aware of any way other than SOST/SCOT/SO01.
Why do you have this requirement? What is the business need?
2014 Nov 04 7:52 AM
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?
2014 Nov 04 7:55 AM
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.
2014 Nov 04 8:01 AM
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
2014 Nov 04 10:07 AM
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?
2014 Nov 04 10:12 AM
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
2014 Nov 04 10:15 AM
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.
2014 Nov 06 3:08 PM
Hi Juan,
Can you please provide how can we proceed by OLE objects?
Thanks for your suggestion.
Regards,
Munu
2014 Nov 06 3:15 PM
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
2014 Nov 06 3:21 PM
Hi,
So why not immediately submit report RSCONN01 after your email.
Kind regards, Rob Dielemans
2014 Nov 06 4:26 PM
2014 Nov 07 6:59 AM
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
2014 Nov 07 8:23 AM
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
2014 Nov 06 7:55 PM
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
2014 Nov 07 6:54 AM
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
2014 Nov 07 7:18 AM
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
2014 Nov 07 7:07 AM
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