Generic program to SEND an email
Hello
Can you help with an ABAP program to sends an email AFTER the Process chain completes. I would like to informational email from process chain as soon as it completes.
Can you post an generic ABAP program that sends an email and please let me know the parameters that needs to be maintained..
Also, suggest me, if there is a GOOD another way to accomplish this task.
Thanks a lot for your help..
Hi,
Genarally, you can create a message, by right click and create message then give email ids in Maintain Recipent list (Recipt type = via internet) and then give message that you want to send in Edit Document.
Check whether the email address is maintained in SU01 in address tab.
Configure SMTP server is set up properly ( SCOT). Ask basis team to do it.
There is also other option to send the mail through program, for this you need to trigger any event or you can insert this program at teh end of the process chain.
*& Report ZTEST_FM_MAIL
REPORT ztest_fm_mail.
DATA : is_doc_chng TYPE sodocchgi1,
it_objtxt TYPE STANDARD TABLE OF solisti1,
is_objtxt TYPE solisti1,
it_objpack TYPE STANDARD TABLE OF sopcklsti1,
is_objpack TYPE sopcklsti1,
it_objbin TYPE STANDARD TABLE OF solisti1,
is_objbin TYPE solisti1,
it_reclist TYPE STANDARD TABLE OF somlreci1,
is_reclist TYPE somlreci1,
w_lines_tx TYPE i.
Create Message Body
Title and Description
*is_doc_chng-obj_name = 'MAIL'.
is_doc_chng-obj_descr = 'Auto genareted Mail'.
main text
is_objtxt-line = 'This is an automatically generated mail. Please do not reply to it.'(028).
APPEND is_objtxt TO it_objtxt.
is_objtxt-line = space.
APPEND is_objtxt TO it_objtxt.
write packing list (main)
DESCRIBE TABLE it_objtxt LINES w_lines_tx.
READ TABLE it_objtxt INTO is_objtxt INDEX w_lines_tx.
is_doc_chng-doc_size = ( w_lines_tx - 1 ) * 255 + STRLEN( is_objtxt ).
CLEAR is_objpack-transf_bin.
is_objpack-head_start = 1.
is_objpack-head_num = 0.
is_objpack-body_start = 1.
is_objpack-body_num = w_lines_tx.
is_objpack-doc_type = 'RAW'.
APPEND is_objpack TO it_objpack.
is_reclist-receiver = 'your email id'.
is_reclist-rec_type = 'U'.
APPEND is_reclist TO it_reclist.
CLEAR is_reclist.
*This is for SAP system mail box
*is_reclist-receiver = 'your system login ID'.
*is_reclist-rec_type = 'B'.
*APPEND is_reclist TO it_reclist.
*CLEAR is_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = is_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_objpack
contents_txt = it_objtxt
receivers = it_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Thanks
Reddy
Similar Messages
-
Program to send multiple emails?
Hi all, I have been using Mailings but it has issues when sending, does anyone know of a Mass Email program?
The trouble with maxbulkmailer is that it a lot harder to use than Mail. Talk about unintuitive!
Our server allows us to send 99 emails/hour. Once a week we send an email to about 500 on our email list. It would be easy to put them in groups of 99 in Address Book, then send out one group each hour if we were around that long. But we aren't in the office that much. An easy fix in Mail would be something that would allow you to designate the time when an email should be sent. Then we could automatically send a different group each hour. Could this be done in Applescript? -
No iWork programs will "send via email"
I can not share any of my saved documents via email in pages or numbers. When I go to the share tab along the top, "send via email" is gray and not able to be clicked. I have seen other threads saying that the character "/" cannot be in the title and none of my documents have this issue. Any thoughts?
It may not be a slash, that is just the most common "illegal" character. Make sure your file name doesn't have anything other than letters, numbers, hyphens or underscores.
But, if you're talking about the share button in the toolbar, that was to share via iWork.com (beta). That service was discontinued last year & it took Apple until the 9.3 update to remove it from the default set of icons.
When all else fails, save the file or export it in the format you want to send & then attach it to a new e-mail message. -
Can i generically change the "send from" email address in mavericks 10.9.2?
I have my regular email address and another that I'd prefer to be sending from. That one doesn't have password as it's a simple forwarding email. Can I send from it? Can't see how without setting it up as full email address.
From the Mail menu bar, select
Window ▹ Connection Doctor
Click the Show Detail button. A drawer opens. Try to send a message and post the text that appears. Anonymize any personal information before posting. -
Mail Program not sending group email
I set up a message group months ago with 33 addresses. Worked fine. Suddenly a few weeks ago, all members of the group reported not getting the messages, but I was not getting any bounce-backs. I checked with GoDaddy where I have an Exchange service. They tested and found that the messages I was sending were being received by their server, not blocked. Yet this group is still not receiving my messages! Simultaneously, I have another message group set up with about 30 addresses. It works fine! I am mystified. Any ideas?
You may get a faster, more targeted response by posting in the OSX 10.4 forums here:
Mac OS X v10.4 Tiger -
Sending an Email using JavaMail from the Net Work of my company not workin
Hi,
If any body would reply to this issue as soon as possible..
I have developed a simple java mail program which sends an email to gmail (smtp.gmail.com) and works fine at home , So when i sent the same
from my office(at company) it did not work and exception was reported saying ...... could not connect to host .smtp.gmail.com... port .. .
I think it's a network problem.
So If any body has a suggestion ?
If so can any body give a simple code for this issue.
Regards,No, I don't mean the msgshow.java demo program. I mean the [JavaMail FAQ|http://java.sun.com/products/javamail/FAQ.html].
In particular, the section about debugging connection problems and the section
about connecting to Gmail.
Find it yet? -
How to send an email/sms in process chain
Hi,
I would like to send an email/SMS in a process chain with same key figures. I get the key figures from a query. But I need a program to send these key figures to email. Is there any programs to send an email like the transaction sbwp?
Thanks in advance!
kind regards
TobiasHi,
you may try this one,
Tcode: ALRTCATDEF
1. select classification "Process Chains"
2. click on display/change
3. double-click on "error in a process of a process chain"
4. click on "fixed recipients"
5. write in your username (you have to maintain your e-mail address in SU01 for that to work)
6. save
Tcode: RSPC
1. go to your process chain (rspc)
2. go into edit mode
3. from the menu, select Process chain -> attributes -> alerting
4. check "send alerts if errors occur" (select as per your requirement )
Hope this helps
Sukhi -
Performance in sending 5000+ emails
Hi,
I'm developing a program for sending 5000+ emails.
I'm having some performance problems. Now I thinking if I could make multi-threaded sending to smtp server. But could my smtp server then overflow the buffers?
How I could ideally send as many e-mails to smtp server at the same time as possibly?
What other tips yo could give for sending multiple e-mails? (coding tips...)
Thanks for advance!Assuming SMTP is the transport, try something like....
Properties props = System.getProperties();
// Set the smtp server name that will receive the message
props.put("mail.smtp.host", smtpserver);
// Set the sendpartial flag to allow the message to be sent even with bad addresses in it.
props.put("mail.smtp.sendpartial", "true");
// Set the protocol to be smtp as we are connecting once to the server and sending many emails
props.put("mail.transport.protocol", "smtp");
session = Session.getDefaultInstance(props, null);
if (smtpDebug)
session.setDebug(true);
// Open the Transport connection
Transport trans = session.getTransport();
trans.connect();
// Create the messages (Could be many many 100s)
// Now to send the message
// set the Date: header note that the java.sql package also defines date
msg2.setSentDate(new java.util.Date());
msg2.setRecipients(addrType, InternetAddress.parse(sendaddr, false));
// Send the message
msg2.saveChanges();
trans.sendMessage(msg2, msg2.getRecipients(addrType));
trans.close();
Cheers,
SH -
Outlook sends duplicate emails
Some users may have encounter the issue that Outlook sends duplicate emails to the recipients, this can be really frustrating as the
causes can be varied so that it’s really hard to troubleshoot . In this article, some most common causes will be introduced, which helps us troubleshoot this kind of
issue.
Send emails on Web first
Before we determine whether it is a server side issue or Outlook client side issue, please logon the webmail, or OWA for Exchange Accounts, send some test emails to have
the recipients to check again whether they receive duplicate emails. If the recipients don’t receive duplicate emails, we can tell it is probably an Outlook client issue.
Anti-Virus program
As some Anti-Virus programs may have been integrated with Outlook to keep the users from spams and viruses, it may also bring some issues sometimes. The program may also scan the outgoing emails and bring troubles, such as making the emails sent multiple
times.
Contact the program provider to know how to disable the integration with Outlook, and exit the Anti-Virus program temporarily, send test emails to see the result.
Similar to Anti-Virus program integration, it can be some add-ins, we can run Outlook in Safe Mode as well:
Run -> Type “outlook.exe /safe” in the blank box -> OK.
If the issue is gone when Outlook is running in Safe Mode, disabling the add-ins which may fix the
problem.
Send/Receive interval conflict
In Outlook we can set an interval according to which Outlook performs a Send/Receive task. Imagine there is an email with a large attachment needs to send, the sending process starts in the first Send/Receive task, but doesn’t complete when the second Send/Receive
starts. Then Outlook may try to send the email again during the second Send/Receive task, which ends up with two same emails in the recipient’s Inbox.
In Outlook 2013, under SEND / RECEIVE tab, click Send/Receive Groups -> Define Send/Receive Groups. We can then see the window below:
The default interval is 30 minutes, if you think it’s too long you can make it shorter. My suggestion is not to set the interval too short, it should be at least 10 minutes, especially when you have multiple accounts setup in Outlook and always need to send
emails with attachments.
Server Timeouts
This is particular for IMAP and POP accounts. When we have a slow Internet or the latency is high, Outlook may not get response from the Server in time, thus Outlook considers the connection to the server is lost, by default, after 1 minute.
However, if the message has actually been sent in the bad Internet condition, but Outlook doesn’t get a response from the server, it may still try to submit the message in the Outbox in the next Send/Receive task.
We can increase the Server Timeouts to 2 or 3 minutes in this scenario, it will be more probably that Outlook can get the correct response from the server if the message is sent.
For IMAP:
For POP:
IMAP Sent Items options
This is only for IMAP accounts. The recipient may not receive duplicate emails but the sender gets duplicate emails in the Sent Items folder.
In Outlook, there are options for us to decide to save the sent items or not for IMAP accounts.
Outlook 2010:
Outlook 2013:
The IMAP account provider may also save a copy on the Server, if you have configured to save a copy in Outlook, this may result in duplicate. In Outlook 2010, select “Do not save copies of sent items” under Sent Items tab; In Outlook 2013, check “Do not
save copies of sent items” under Advanced tab. Then send test emails to check the result.
Another thing to check is under FILE tab -> Options -> Mail -> Save messages -> Save copies of messages in the Sent Items folder, we can uncheck this option to see the result. What we should note is it’s a global option that applies to all accounts.
If your provider doesn’t save emails on the server, it’s better not to uncheck this setting.
To know if the provider saves the sent emails on the server, contact them or check the webmail settings.
If you have anything to add or any feedback, feel free to let me know.
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.Hi,
I found two related links, It might be caused by two or more Outlook clients are logged into the same mailbox at the same time, or some inappropriate configurations in Outlook.
Outlook 2010 sending 2 emails when sending a email. (duplicate email)
http://social.technet.microsoft.com/Forums/office/en-US/8378baff-8c5a-47bc-90a6-8f9c61b2b394/outlook-2010-sending-2-emails-when-sending-a-email-duplicate-email?forum=outlook
Duplicate Messages in Outlook
http://blogs.technet.com/b/scotch/archive/2010/04/14/duplicate-messages-in-outlook.aspx
Hope these can give you some hints , It's recommended to post in this forum if you still have issue about Outlook, they're more familiar with Outlook.
Outlook IT Pro Forum
http://social.technet.microsoft.com/Forums/office/en-US/home?forum=outlook
Yolanda Zhu
TechNet Community Support -
Sending an email from within a program
Hi,
I am using SO_DOCUMENT_SEND_API1 to send an email from a program. Everything works fine, but the users don't want to see the popup message titled 'SAPconnect Send Process - List of Sent Objects'.
Is there anyway I can supress this message from the program, or is it a setting in SAPconnect?
Thanks
LindyIf your are calling RSCONN01 after your function module then remove the submit of RSCONN01. This program will run scheduled every 1 to 5 minutes anyway as background job by the basis .
a® -
In my Mail program (4.6), OS10.6.8, can I send bulk email bcc? If so is there a limit to the number of names/addresses that I can send?
To add the BCC field to the message window, create a new message, click the 'three lines' button near the to and from fields & select the 'BCC Address field' or choose the 'customise' option. This button may be a 'gear' on the older OS (I don't recall for 10.6.8 Mail).
The BCC field is more likely to be limited by the email server than Mail app. If you add hundreds of addresses (or use large groups with many addresses) the email server may assume you are sending spam. Sometimes it causes the server to drop the message or bounce them, different providers also have different rules, so you need to use bcc & ccc with care.
If you plan on doing mass mailing you would be better with a service that handles it correctly for you (i.e. sends multiple messages without using ccc or bcc). -
ABAP program for sending emails
Hello SAP developers,
I need ABAP program for sending emails to my internet adress in background - just some simple header with no body and no attachement. Recipient should be specified due the parameter etc... Does program like this exist or i have to create it? I am not familiar with ABAP. I am basis admin so I am little bit lost in this. I have tried program code from this page ->
http://www.sapdevelopment.co.uk/reporting/email/email_mbody.htm
But anyway it does not work - there is an exception "no message send". SCOT is configured, mails are working fine from transaction SBWP.
Thanks in advace
JMI have already solved my issue through CCMS agents and RZ20 central autoreaction (sms) in Solution Manager.
Regards
JM -
Sending an email to users from abap program
Hi experts ,
How to send an email to users from abap program ...
i need full coding please..so that i can copy and paste it in my program.
Thank you in advance.
Rajasekhar.PHi Venkat
check the below simple code to convert spool to HTML and email it
data: list type table of abaplist with header line.
data: htmllines type table of w3html with header line.
data: maildata like sodocchgi1.
data: mailtxt like solisti1 occurs 10 with header line.
data: mailrec like somlrec90 occurs 0 with header line.
start-of-selection.
Produce a list
do 100 times.
write:/ sy-index, at 30 sy-index, at 50 sy-index.
enddo.
Save the list
call function 'SAVE_LIST'
tables
listobject = list
exceptions
list_index_invalid = 1
others = 2.
Convert the list
call function 'WWW_LIST_TO_HTML'
tables
html = htmllines.
Send mail
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test Subject'.
loop at htmllines.
mailtxt = htmllines.
append mailtxt.
endloop.
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'HTM'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif. -
Everytime I send an email the warning box appears--- WebKit2 WebProcess,exe has stopped working. Then I hit close program and it shuts me out of my inbox.
If I don't close the warning box my computer stay s in limbo. What is is? It is not in my control panel and does not come up as a program in my computer.
Help?Taken at face value, you're having trouble with an Apple Application Support program file there. (Apple Application Support is where single copies of program files used by multiple different Apple programs are kept.)
Let's try something relatively simple first. Restart the PC. If you're using Vista or 7, now head into your Uninstall a program control panel, select "Apple Application Support" and then click "Repair". If you're using XP, head into your Add or Remove Programs control panel, select "Apple Application Support", click "Change" and then click "Repair". -
PSE 8 No Email Program Error When Sending an Email
Hi Everyone,
I have a student who has a pretty new computer running Win 7 with PSE 8. She has set up her email sharing with Adobe Services and has received/entered the verification code. However, when trying to send an email, she gets the following error message as soon as she hits Send.
"There is no e-mail program associated to perform the requested action. Please install an email program or, if one is already installed, create an association in the Default Programs control panel."
Running PSE 8 as an administrator does not correct the problem. I thought that when you are using Adobe Email Service, you did not need an email program, like OL or Microsoft Mail. ??
TIA Don S.No, I never did get an answer.
To be honest I cannot remember if my student resolved their problem. I have never had that specific error message, and the last time I checked PSE 8 was emailing fine. HOWEVER, just yesterday, the only way I could send email from within PSE 7 was to not include any names from the PSE Contact list. This always caused PSE 7 to crash for both OL and Adobe Email Service, Photo Mail or Attachments. I have not checked PSE 8 yet.
I found out about the PSE 7 problem from a friend using OL. For her, it was working but all of a sudden, began to crash PSE 7.
Does anyone know if PSE 7/8 connects with Adobe while emailing, even if OL is used as the email client?
Don S.
Maybe you are looking for
-
Hello all.. need help badly! Was in the process of adding blackberry desktop to a new computer (Windows 8); program went in fine but the Playbook was still connected and now it says that the playbook is not finished downloading its program and does n
-
Not able to Book Sales Order.
Hi, I ahve entered the order information. When i am trying to Book it, I am getting the below error:The Booking Activity has errored out, please contact your System Administrator. Can anyone help me with a solution for this. Regards, Sravan.
-
Problem with finding BADI for transaction F9K2
I Found many BADIs for the transaction...but am not able to decide which is suitable for my requirement.. my requirement is ..i need to keep check box removing radiobutton in the the transctio F9K2 in tab 'accounts statements' in Bk.st.orig column.
-
I am planning to buy apple air mac book. i am not that technical will i be able to handle apple mac book. i am aware of using windows os but can i get software like that of notepad, word pad in os X lion. can i get partitioning in macbook,
-
Other growing at alarming rate
when syncing my iphone 4s on the bottom of the page in itunes it shows (blue) for audio, (orange) for photos, (green) for apps, (yellow) for other. My question is what is OTHER? I have tried to find this out and can't seem to find anything on it. It