2007 Feb 14 6:18 PM
hai
what is the function module used for sending a mail to yahoo or gmail etcc.....
thx in advance
2007 Feb 14 6:23 PM
Hi,
Please check this FM.
SO_NEW_DOCUMENT_ATT_SEND_API1
SO_OBJECT_SEND
Please check this link for sample code.
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
Regards,
Ferry Lianto
hai
what is the function module used for sending a mail to yahoo or gmail etcc.....
thx in advance
2007 Feb 14 6:23 PM
Hi,
Please check this FM.
SO_NEW_DOCUMENT_ATT_SEND_API1
SO_OBJECT_SEND
Please check this link for sample code.
http://www.sapdevelopment.co.uk/reporting/email/emailhome.htm
Regards,
Ferry Lianto
2007 Feb 14 6:40 PM
2007 Feb 14 6:42 PM
Hi
use the function module <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b>
/people/thomas.jung3/blog/2004/09/07/sending-e-mail-from-abap--version-46d-and-lower--api-interface
Regards
Sudheer
2007 Feb 14 7:25 PM
Hi,
Check this sample code..
Declarations.
PARAMETERS: p_email(50) LOWER CASE.
DATA: document_data LIKE sodocchgi1.
DATA: t_content LIKE STANDARD TABLE OF solisti1.
DATA: s_content LIKE solisti1.
DATA: t_receivers LIKE STANDARD TABLE OF somlreci1.
DATA: s_receivers LIKE somlreci1.
START-OF-SELECTION.
Receivers.
s_receivers-receiver = p_email.
s_receivers-rec_type = 'U'.
s_receivers-express = 'X'.
APPEND s_receivers TO t_receivers.
Subject
document_data-obj_descr = 'New mail from Sap'.
Body
s_content = 'Hi,'.
APPEND s_content TO t_content.
CLEAR: s_content.
APPEND s_content TO t_content.
s_content = 'Test email from sap, please don''t reply to this email'.
APPEND s_content TO t_content.
CLEAR: s_content.
APPEND s_content TO t_content.
s_content = 'Thanks,'.
APPEND s_content TO t_content.
s_content = 'Naren.'.
APPEND s_content TO t_content.
Send the email.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = document_data
TABLES
object_content = t_content
receivers = t_receivers
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 e208(00) WITH 'Error in sending email :-(('.
ELSE.
MESSAGE s208(00) WITH 'Email sent )'.
ENDIF.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
Thanks,
Naren
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |