Problem sending external emails
Hello,
we are trying to have our SAP system send mails to external customers and are having problems. The mails that we send to our internal users are working fine.
we are on ECC6 and using a Microsoft exchange 2007 mail server. Our servers are outsourced.
The things that we have done so far are:
we have look at note 455140 and have that in place.
we have a user set up in SU01 with the external address.
we have sent our SAP IP address to the mail support team and they authenticated in SMTP relay.
we have configured SCOT and able to send emails internal users. *.mycompany.com
we have checked the mail functions that can be used within ABAP code to see if there is a way to authenticate to the server with a user id and password.
we can see that the emails are getting sent to the SMTP server but are being blocked at that point. our mail support team is stating that our problem is that we are not authenticating to the SMTP server. They are telling us that we have to sign in with a userid and password every time that we want to send a mail.
please let us know if there is something else that we need to do in order to get this work. if there is someone in here that is running ECC6 with a Microsoft exchange 2007 mail server that is successfully sending emails to external customers ( we have no issues with internal emails), can you please let us know what steps you have performed in order to get the process to work.
Edited by: Timothy Hixson on Oct 24, 2011 8:43 PM
Timothy Hixson wrote:
If you have a Mail team just ask them to add the IP Address of your SAP Servers into the SMTP Relay Agent and that should fix your issue
>
> we have asked the mail team to do this and they have responded that they did. They are telling us that we have to authenicate to the mail server.
I would suggest to discuss with your mail team that SAP does not support authentication mechanism in SMTP. So, install one relay agent between SAP system and mail server so that when mails are sent from SAP system to relay agent then relay agent will authenticate to your mail server and mail will be sent then.
Thanks
Sunny
Similar Messages
-
I have an Ipad 2 and are having problems sending out emails in one of my email address. This is a POP3 email Account? I always get a message reading that the email was not sent because the server does not allow relaying. I have no such problem with gmail. What could be the problem and how do I resolve this. Is it about settings?
Richard.Welcome to the Apple community.
If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact Apple ID Support, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do. -
Need to send external email with attachment for workflow 20000075
Hello Everyone,
I am new to W/F, I Need to send external email with attachment for PO Release W/F 20000075. Currently Work item is being sent to SAP inbox of required user based on PO Release strategy configuration in SPRO. I tried to create Send mail step after PO release event but I am not sure how to arrive at Recipient type in send mail step(the mail should be sent to person in the release strategy). Everything looks fine all I need to do is to send external email with attachment instead of sending work item into SAP inbox.
Your help will be highly appreciated.
Thanks.You can use extended notifications to send an e-mail message with a link to the workitem. Search for extended notifications in SDN.
Regards,
Martin -
I have problem sending a email ..spool not created using custom FM
Hi experts,
i have problem sending a email ..spool not created using custom FM...this the custom FM
* Send email notification
lv_subject = text-037.
lv_attachment = text-038.
CALL FUNCTION 'Z_SEND_EMAIL_FROM_SPOOL'
EXPORTING
email1 = lv_email1
email2 = lv_email2
email3 = lv_email3
subject = lv_subject
attachment_name = lv_attachment
EXCEPTIONS
spool_not_created = 1
OTHERS = 2.
Source code
this is the source code for this FM
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
PERFORM convert_spool_to_pdf.
IF sy-subrc IS NOT INITIAL.
MESSAGE e040(zhrcd) RAISING spool_not_created.
ENDIF.
PERFORM process_email USING email1
email2
email3
subject
attachment_name.
WAIT UP TO 5 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.....
Please let me know
Edited by: Thomas Zloch on Nov 16, 2010 5:53 PM - please use code tagsHi srinivas ,
Could you please Check
FORM summary_report .
DATA: lv_success TYPE i,
lv_error TYPE i,
lv_total TYPE i.
DESCRIBE TABLE gt_data LINES lv_success.
DESCRIBE TABLE gt_error LINES lv_error.
DESCRIBE TABLE gt_message LINES lv_error.
lv_total = lv_success + lv_error.
lv_total = lv_success.
gwa_summary-record = text-008."Number of Successful records.
gwa_summary-number = lv_success.
APPEND gwa_summary TO gt_summary.
gwa_summary-record = text-009."Number of error records'.
gwa_summary-number = lv_error.
APPEND gwa_summary TO gt_summary.
gwa_summary-record = text-010."Total number of records processed.
gwa_summary-number = lv_total.
APPEND gwa_summary TO gt_summary.
CLEAR gt_fieldcat.
gwa_fieldcat_summ-col_pos = 1 .
gwa_fieldcat_summ-fieldname = 'RECORD'.
gwa_fieldcat_summ-tabname = 'GT_SUMMARY'.
gwa_fieldcat_summ-seltext_l = text-011."Records
gwa_fieldcat_summ-outputlen = '70'.
APPEND gwa_fieldcat_summ TO gt_fieldcat_summ.
gwa_fieldcat_summ-col_pos = 2 .
gwa_fieldcat_summ-fieldname = 'NUMBER'.
gwa_fieldcat_summ-tabname = 'GT_SUMMARY'.
gwa_fieldcat_summ-seltext_l = text-012."Number
gwa_fieldcat_summ-outputlen = '10'.
APPEND gwa_fieldcat_summ TO gt_fieldcat_summ.
ENDFORM. " SUMMARY_REPORT
*& Form ERROR_REPORT
FORM error_report .
gt_fieldcat_err[] = gt_fieldcat[].
gv_fieldcat_err-col_pos = 1.
gv_fieldcat_err-fieldname = 'PERNR'.
gv_fieldcat_err-tabname = 'GT_MESSAGE'.
gv_fieldcat_err-seltext_l = text-070."Employee Number
gv_fieldcat_err-outputlen = '20'.
APPEND gv_fieldcat_err TO gt_fieldcat_err.
gv_fieldcat_err-col_pos = 2.
gv_fieldcat_err-fieldname = 'MESSAGE'.
gv_fieldcat_err-tabname = 'GT_MESSAGE'.
gv_fieldcat_err-seltext_l = text-071."Error Message
gv_fieldcat_err-outputlen = '80'.
APPEND gv_fieldcat_err TO gt_fieldcat_err.
ENDFORM. " ERROR_REPORT
*& Form FINAL_REPORT
FORM final_report .
DATA:lv_layout TYPE slis_layout_alv,
lt_events_summ TYPE slis_t_event,
lv_events_summ LIKE LINE OF lt_events_summ,
lt_events_det TYPE slis_t_event,
lv_events_det LIKE LINE OF lt_events_det,
lt_events_err TYPE slis_t_event,
lv_events_err LIKE LINE OF lt_events_det,
lt_events_msg TYPE slis_t_event,
lv_events_msg LIKE LINE OF lt_events_det.
lv_events_summ-name = 'TOP_OF_PAGE'.
lv_events_summ-form = 'TOP_OF_PAGE1'.
APPEND lv_events_summ TO lt_events_summ.
lv_events_det-name = 'TOP_OF_PAGE'.
lv_events_det-form = 'TOP_OF_PAGE2'.
APPEND lv_events_det TO lt_events_det.
lv_events_err-name = 'TOP_OF_PAGE'.
lv_events_err-form = 'TOP_OF_PAGE3'.
APPEND lv_events_err TO lt_events_err.
lv_events_msg-name = 'TOP_OF_PAGE'.
lv_events_msg-form = 'TOP_OF_PAGE4'.
APPEND lv_events_msg TO lt_events_msg.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = sy-repid.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = gt_fieldcat_summ
i_tabname = 'IT_SUMMARY'
it_events = lt_events_summ
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = gt_summary
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF CHK_DTL IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = gt_fieldcat
i_tabname = 'gt_data'
it_events = lt_events_det
IT_SORT =
I_TEXT = ' '
TABLES
t_outtab = gt_data
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = gt_fieldcat_err
i_tabname = 'gt_error'
it_events = lt_events_err
TABLES
t_outtab = gt_error.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = gt_fieldcat_msg
i_tabname = 'gt_message'
it_events = lt_events_msg
TABLES
t_outtab = gt_error.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = gt_fieldcat_err
i_tabname = 'gt_message'
it_events = lt_events_err
TABLES
t_outtab = gt_message.
IF GT_MESSAGE[] IS NOT INITIAL.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = lv_layout
it_fieldcat = gt_fieldcat_msg
i_tabname = 'gt_message'
it_events = lt_events_msg
TABLES
t_outtab = gt_message.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
i_interface_check = ' '
IS_PRINT =
i_screen_start_column = 0
i_screen_start_line = 0
i_screen_end_column = 0
i_screen_end_line = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
ENDFORM. " FINAL_REPORT
*& Form top_of_page
text
FORM top_of_page1. "#EC CALLED
WRITE text-013."SUMMARY REPORT.
ENDFORM. "top_of_page
*& Form top_of_page2
text
FORM top_of_page2. "#EC CALLED
WRITE text-014."DETAIL REPORT.
ENDFORM. "top_of_page
*& Form top_of_page3
text
FORM top_of_page3. "#EC CALLED
WRITE text-015."ERROR REPORT
ENDFORM. "top_of_page
*& Form EMAIL_NOTIFICATION
FORM email_notification .
DATA: lv_email1 TYPE somlreci1-receiver,
lv_email2 TYPE somlreci1-receiver,
lv_email3 TYPE somlreci1-receiver,
lv_subject TYPE char200,
c_flag TYPE c VALUE 'X',
lv_attachment TYPE char50.
CLEAR: lv_email1,
lv_email2,
lv_email3,
lv_subject,
lv_attachment.
SELECT SINGLE email1
email2
email3
FROM zhr_interface_pr
INTO (lv_email1,lv_email2,lv_email3)
WHERE zinterfaceid EQ gc_objectid.
IF sy-subrc EQ 0.
IF sy-batch EQ 'X'.
Send email notification
lv_subject = text-037.
lv_attachment = text-038.
CALL FUNCTION 'Z_SEND_EMAIL_FROM_SPOOL'
EXPORTING
email1 = lv_email1
email2 = lv_email2
email3 = lv_email3
subject = lv_subject
attachment_name = lv_attachment
EXCEPTIONS
spool_not_created = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. "
Edited by: katewinslate@SAP on Nov 17, 2010 12:50 PM -
Sending external email via SAPCONNECT
Hi all,
I want to know how to send external email through sap.
Thanks in advance,
Manosh.HI,
Try this code:
*& Report ZSENDEMAIL *
*& Example of sending external email via SAPCONNECT *
REPORT zsendemail .
PARAMETERS: psubject(40) type c default 'Hello',
p_email(40) type c default '[email protected]' .
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form POPULATE_MESSAGE_TABLE
Adds text to email text table
form populate_message_table.
Append 'Email line 1' to it_message.
Append 'Email line 2' to it_message.
Append 'Email line 3' to it_message.
Append 'Email line 4' to it_message.
endform. " POPULATE_MESSAGE_TABLE
*& Form SEND_EMAIL_MESSAGE
Send email message
form send_email_message.
Fill the document data.
gd_doc_data-doc_size = 1.
Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_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.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
endform. " SEND_EMAIL_MESSAGE
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
Reward points if found helpful....
Cheers,
Chandra Sekhar. -
Error - Problem sending invitation email
Hi
I am trying to invite a admin user, but i never get an email from BC
This i the error when im resend invitation email :
Error - Problem sending invitation email
Thanks
FinnI am having a similar issue - the email appears to have been created but the activation email was never sent... now we can not remove the busted one or create a log in in a client! - how to repair?
-
Please help in senplease help in smartform send external email send.
hii all,
pleaseeeeeeeee help in sending external email in smartform print program.
i need for RLB_INVOICE order confirmation to send thru email.
what to code in ZRLN_INVOICE . i copied RLB_INVOICE in zprog.
so what rthe changes i need to code in driver program?
pleaseeeeeeee help with sample coding..Here is the code to send the Smartform to mail as PDF attachment.
*& Report ZTEST_PDF_MAIL
REPORT ZTEST_PDF_MAIL.
Internal Table declarations
DATA: I_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
I_TLINE TYPE TABLE OF TLINE WITH HEADER LINE,
I_RECEIVERS TYPE TABLE OF SOMLRECI1 WITH HEADER LINE,
I_RECORD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
Objects to send mail.
I_OBJPACK LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
I_OBJTXT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_OBJBIN LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
I_RECLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
Work Area declarations
WA_OBJHEAD TYPE SOLI_TAB,
W_CTRLOP TYPE SSFCTRLOP,
W_COMPOP TYPE SSFCOMPOP,
W_RETURN TYPE SSFCRESCL,
WA_DOC_CHNG TYPE SODOCCHGI1,
W_DATA TYPE SODOCCHGI1,
WA_BUFFER TYPE STRING, "To convert from 132 to 255
Variables declarations
V_FORM_NAME TYPE RS38L_FNAM,
V_LEN_IN LIKE SOOD-OBJLEN,
V_LEN_OUT LIKE SOOD-OBJLEN,
V_LEN_OUTN TYPE I,
V_LINES_TXT TYPE I,
V_LINES_BIN TYPE I.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZTEST'
IMPORTING
FM_NAME = V_FORM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
W_CTRLOP-GETOTF = 'X'.
W_CTRLOP-NO_DIALOG = 'X'.
W_COMPOP-TDNOPREV = 'X'.
CALL FUNCTION V_FORM_NAME
EXPORTING
CONTROL_PARAMETERS = W_CTRLOP
OUTPUT_OPTIONS = W_COMPOP
USER_SETTINGS = 'X'
IMPORTING
JOB_OUTPUT_INFO = W_RETURN
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
I_OTF[] = W_RETURN-OTFDATA[].
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
FORMAT = 'PDF'
MAX_LINEWIDTH = 132
IMPORTING
BIN_FILESIZE = V_LEN_IN
TABLES
OTF = I_OTF
LINES = I_TLINE
EXCEPTIONS
ERR_MAX_LINEWIDTH = 1
ERR_FORMAT = 2
ERR_CONV_NOT_POSSIBLE = 3
OTHERS = 4.
IF SY-SUBRC <> 0.
ENDIF.
LOOP AT I_TLINE.
TRANSLATE I_TLINE USING '~'.
CONCATENATE WA_BUFFER I_TLINE INTO WA_BUFFER.
ENDLOOP.
TRANSLATE WA_BUFFER USING '~'.
DO.
I_RECORD = WA_BUFFER.
APPEND I_RECORD.
SHIFT WA_BUFFER LEFT BY 255 PLACES.
IF WA_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH: I_RECLIST,
I_OBJTXT,
I_OBJBIN,
I_OBJPACK.
CLEAR WA_OBJHEAD.
I_OBJBIN[] = I_RECORD[].
Create Message Body Title and Description
I_OBJTXT = 'test with pdf-Attachment!'.
APPEND I_OBJTXT.
DESCRIBE TABLE I_OBJTXT LINES V_LINES_TXT.
READ TABLE I_OBJTXT INDEX V_LINES_TXT.
WA_DOC_CHNG-OBJ_NAME = 'smartform'.
WA_DOC_CHNG-EXPIRY_DAT = SY-DATUM + 10.
WA_DOC_CHNG-OBJ_DESCR = 'smartform'.
WA_DOC_CHNG-SENSITIVTY = 'F'.
WA_DOC_CHNG-DOC_SIZE = V_LINES_TXT * 255.
Main Text
CLEAR I_OBJPACK-TRANSF_BIN.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
I_OBJPACK-BODY_NUM = V_LINES_TXT.
I_OBJPACK-DOC_TYPE = 'RAW'.
APPEND I_OBJPACK.
Attachment (pdf-Attachment)
I_OBJPACK-TRANSF_BIN = 'X'.
I_OBJPACK-HEAD_START = 1.
I_OBJPACK-HEAD_NUM = 0.
I_OBJPACK-BODY_START = 1.
DESCRIBE TABLE I_OBJBIN LINES V_LINES_BIN.
READ TABLE I_OBJBIN INDEX V_LINES_BIN.
I_OBJPACK-DOC_SIZE = V_LINES_BIN * 255 .
I_OBJPACK-BODY_NUM = V_LINES_BIN.
I_OBJPACK-DOC_TYPE = 'PDF'.
I_OBJPACK-OBJ_NAME = 'smart'.
I_OBJPACK-OBJ_DESCR = 'test'.
APPEND I_OBJPACK.
CLEAR I_RECLIST.
I_RECLIST-RECEIVER = '[email protected]'.
I_RECLIST-REC_TYPE = 'U'.
APPEND I_RECLIST.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_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.
WRITE:/ 'Error When Sending the File', SY-SUBRC.
ELSE.
WRITE:/ 'Mail sent'.
ENDIF.
If you want to send some text as Body of the Mail then follow this once
when u r callin the FM'SO_NEW_DOCUMENT_ATT_SEND_API1'.. points to remember
1.u have to pass the body of content in table CONTENTS_TXT(ia m using I_OBJBIN) (each line a record) then. suppose i have appended 11 records to the table CONTENTS_TXT .
2.PACKING_LIST(iam usign I_OBJPACK) table u ahve to append a redord as follows
I_OBJPACK-TRANSF_BIN = ' '.
I_OBJPACK-HEAD_START = 000000000000001.
I_OBJPACK-HEAD_NUM = 000000000000001.
I_OBJPACK-BODY_START = 000000000000002
I_OBJPACK-BODY_NUM = 000000000000010.
I_OBJPACK-DOC_TYPE = 'RAW'.
append I_OBJPACK-.
by the above code system treat the first line in table I_OBJBIN as header and the 2nd line to 10 lines tread as body.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = WA_DOC_CHNG
PUT_IN_OUTBOX = 'X'
TABLES
PACKING_LIST = I_OBJPACK
OBJECT_HEADER = WA_OBJHEAD
CONTENTS_BIN = I_OBJBIN
CONTENTS_TXT = I_OBJTXT
RECEIVERS = I_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.
regards,
srinivas -
Problem sending out emails offsite. iPad
Hi fellow apple users,
Could anyone assist?
I have no problem sending out email when using it at office.
But when I go offsite to send out email, i was prompted 'Cannot Send Mail'. A copy has been placed in your outbox. The recipient was rejected by server because it does not allow relaying.
Any good souls out there who can assist?
Thanks a bunch!Hi al,
Here is a link to a site that explains the whole "relaying" thing. Because there are various reasons you may be getting this message, thought this might be helpful:
http://www.gammadyne.com/relaying_denied.htm
Hope this sheds some light on your issue!
GB -
Sending external email from SAP with following requirements...
Hi All,
I need to send external emails from SAP by meeting following requirements.
1) With subject line more than 100 characters.
2) No attachments, only body which has specific format (blueprint/layout) and would be amended often, hence code shouldn't be touched during amendments.
3) Should be able to know the success/failure of mail sending at program level.Hi,
The code below demonstrates how to send an email to an external email address
*& Report ZSENDEMAIL *
*& Example of sending external email via SAPCONNECT *
REPORT zsendemail .
PARAMETERS: psubject(40) type c default 'Hello',
p_email(40) type c default '[email protected]' .
data: it_packing_list like sopcklsti1 occurs 0 with header line,
it_contents like solisti1 occurs 0 with header line,
it_receivers like somlreci1 occurs 0 with header line,
it_attachment like solisti1 occurs 0 with header line,
gd_cnt type i,
gd_sent_all(1) type c,
gd_doc_data like sodocchgi1,
gd_error type sy-subrc.
data: it_message type standard table of SOLISTI1 initial size 0
with header line.
*START-OF-SELECTION.
START-OF-SELECTION.
Perform populate_message_table.
*Send email message, although is not sent from SAP until mail send
*program has been executed(rsconn01)
PERFORM send_email_message.
*Instructs mail send program for SAPCONNECT to send email(rsconn01)
perform initiate_mail_execute_program.
*& Form POPULATE_MESSAGE_TABLE
Adds text to email text table
form populate_message_table.
Append 'Email line 1' to it_message.
Append 'Email line 2' to it_message.
Append 'Email line 3' to it_message.
Append 'Email line 4' to it_message.
endform. " POPULATE_MESSAGE_TABLE
*& Form SEND_EMAIL_MESSAGE
Send email message
form send_email_message.
Fill the document data.
gd_doc_data-doc_size = 1.
Populate the subject/generic message attributes
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SAPRPT'.
gd_doc_data-obj_descr = psubject.
gd_doc_data-sensitivty = 'F'.
Describe the body of the message
clear it_packing_list.
refresh it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
describe table it_message lines it_packing_list-body_num.
it_packing_list-doc_type = 'RAW'.
append it_packing_list.
Add the recipients email address
clear it_receivers.
refresh it_receivers.
it_receivers-receiver = p_email.
it_receivers-rec_type = 'U'.
it_receivers-com_type = 'INT'.
it_receivers-notif_del = 'X'.
it_receivers-notif_ndel = 'X'.
append it_receivers.
Call the FM to post the message to SAPMAIL
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = gd_doc_data
put_in_outbox = 'X'
importing
sent_to_all = gd_sent_all
tables
packing_list = it_packing_list
contents_txt = it_message
receivers = it_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.
Store function module return code
gd_error = sy-subrc.
Get it_receivers return code
loop at it_receivers.
endloop.
endform. " SEND_EMAIL_MESSAGE
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
form initiate_mail_execute_program.
wait up to 2 seconds.
if gd_error eq 0.
submit rsconn01 with mode = 'INT'
with output = 'X'
and return.
endif.
endform. " INITIATE_MAIL_EXECUTE_PROGRAM
Hope this helps.
Reward if helpful.
Regards,
Sipra -
To send external email from ABAP
How to send external email from ABAP Program and what are the settings to be done for the same ?
Please check..
Sending External email through SAP
What is the FM for sending the external email through SAP by attaching layout set to it?
These are the FM for sending external email :-
SO_DOCUMENT_SEND_API1
SAPoffice: Send new document with attachments via RFC
SO_NEW_DOCUMENT_ATT_SEND_API1
(In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
SAPoffice: Send new document with attachments via RFC
Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
SO_NEW_DOCUMENT_SEND_API1
SAPoffice: Send new document
How to send a report to an external mail-id?
Try this sample code :-
REPORT ZREPORT_TO_EMAIL NO STANDARD PAGE HEADING LINE-SIZE 200.
DATA : BEGIN OF ITAB OCCURS 0,
PERNR LIKE PA0001-PERNR,
ENAME LIKE PA0001-ENAME,
END OF ITAB.
DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
listobject LIKE abaplist OCCURS 10,
compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
w_object_hd_change LIKE sood1,
compressed_size LIKE sy-index.
START-OF-SELECTION.
SELECT PERNR ENAME
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM PA0001
WHERE PERNR < 50.
LOOP AT ITAB.
WRITE :/02 SY-VLINE , ITAB-PERNR, 15 SY-VLINE , ITAB-ENAME, 50
SY-VLINE.
ENDLOOP.
Receivers
receiver_list-recextnam = '[email protected]'. "-->
EMAIL ADDRESS
RECEIVER_list-RECESC = 'E'. "<-
RECEIVER_list-SNDART = 'INT'."<-
RECEIVER_list-SNDPRI = '1'."<-
APPEND receiver_list.
General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
Mail subject
w_object_hd_change-objdes = 'Message subject'.
Mail body
APPEND 'Message content' TO message_content.
Attachment
CALL FUNCTION 'SAVE_LIST'
EXPORTING
list_index = '0'
TABLES
listobject = listobject.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
compressed_size = compressed_size
TABLES
in = listobject
out = compressed_attachment.
DESCRIBE TABLE compressed_attachment.
CLEAR packing_list.
packing_list-transf_bin = 'X'.
packing_list-head_start = 0.
packing_list-head_num = 0.
packing_list-body_start = 1.
packing_list-body_num = sy-tfill.
packing_list-objtp = 'ALI'.
packing_list-objnam = 'Object name'.
packing_list-objdes = 'Attachment description'.
packing_list-objlen = compressed_size.
APPEND packing_list.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
TABLES
objcont = message_content
receivers = receiver_list
packing_list = packing_list
att_cont = compressed_attachment. -
I use FM SO_OBJECT_SEND to send external email in my Z program but the output always in attachment format, depend on the format i specified (pdf,htm,txt,xls). I want the output to be in standard email body. How to do it?
Hi,
Can you please send your code or check if you are passing att_cont parameter in your function module. I would suggest you to use SO_NEW_DOCUMENT_SEND_API1 function module to send mail.
Also find the code below for your reference.
REPORT z_test_email_sending.
DATA: t_reclist TYPE TABLE OF somlreci1,
wa_receiver LIKE LINE OF t_reclist,
objcont TYPE TABLE OF solisti1,
subject TYPE TABLE OF solisti1,
objline TYPE solisti1,
w_line_count TYPE i,
doc_chng TYPE sodocchgi1,
offset type i.
CONSTANTS c_sep TYPE c VALUE '|'.
DATA : BEGIN OF mail_line OCCURS 0,
sep0,
model_year(6),
sep1,
mf(4),
sep2,
type(5),
sep3,
variant(14),
sep4,
kitype(5),
sep5,
option(8),
sep6,
color(8),
sep7,
uph(11),
sep8,
struc_week(10),
sep9,
END OF mail_line.
*construct the message and the e-mail
wa_receiver-receiver = receivers mail id.
* Email Subject
doc_chng-obj_name = 'test mail'.
MOVE 'Cost Error from SAP' TO doc_chng-obj_descr.
doc_chng-obj_langu = sy-langu.
* doc_chng-SENSITIVTY = 'P'.
* Email body
CLEAR objline.
CONCATENATE 'This is an automatically generated email'
'Please do not reply to this email.'
INTO objline SEPARATED BY space.
APPEND objline TO objcont.
CLEAR objline.
APPEND objline TO objcont.
CONCATENATE 'Cost errors in SAP as on' sy-datum INTO
objline SEPARATED BY space.
APPEND objline TO objcont.
CLEAR objline.
CLEAR objline.
APPEND objline TO objcont.
* horizontal line at beginning of records
DO 80 TIMES.
IF sy-index = 1.
* objline+sy-index(1) = ' '.
continue.
ELSE.
offset = sy-index - 1.
objline+offset(1) = '-'.
ENDIF.
ENDDO.
clear offset.
APPEND objline TO objcont.
CLEAR objline.
mail_line-sep0 = c_sep.
mail_line-model_year = 'Model Yr'.
mail_line-sep1 = c_sep.
mail_line-mf = 'Mf'.
mail_line-sep2 = c_sep.
mail_line-type = 'Type'.
mail_line-sep3 = c_sep.
mail_line-variant = 'Variant'.
mail_line-sep4 = c_sep.
mail_line-kitype = 'Ki-type'.
mail_line-sep5 = c_sep.
mail_line-option = 'Option'.
mail_line-sep6 = c_sep.
mail_line-color = 'Color'.
mail_line-sep7 = c_sep.
mail_line-uph = 'Upholstery'.
mail_line-sep8 = c_sep.
mail_line-struc_week = 'Str_week'.
mail_line-sep9 = c_sep.
MOVE mail_line TO objline.
APPEND objline TO objcont.
CLEAR mail_line.
CLEAR objline.
* horizontal line at beginning of records
*horizontal line at beginning of records
DO 80 TIMES.
IF sy-index = 1.
* objline+sy-index(1) = ' '.
continue.
ELSE.
offset = sy-index - 1.
objline+offset(1) = '-'.
ENDIF.
ENDDO.
clear offset.
APPEND objline TO objcont.CLEAR objline.
DO 5 TIMES.
mail_line-sep0 = c_sep.
mail_line-model_year = 'xxxx'.
mail_line-sep1 = c_sep.
mail_line-mf = 'xxx'.
mail_line-sep2 = c_sep.
mail_line-type = 'xxx'.
mail_line-sep3 = c_sep.
mail_line-variant = 'xxxx xxxxx'.
mail_line-sep4 = c_sep.
mail_line-kitype = 'xxx'.
mail_line-sep5 = c_sep.
mail_line-option = 'xxxxxx'.
mail_line-sep6 = c_sep.
mail_line-color = 'xxxxxx'.
mail_line-sep7 = c_sep.
mail_line-uph = 'xxxxxx'.
mail_line-sep8 = c_sep.
mail_line-struc_week = 'xxxxxx'.
mail_line-sep9 = c_sep.
MOVE mail_line TO objline.
APPEND objline TO objcont.
ENDDO.
CLEAR objline.
*horizontal line at beginning of records
DO 80 TIMES.
IF sy-index = 1.
* objline+sy-index(1) = ' '.
continue.
ELSE.
offset = sy-index - 1.
objline+offset(1) = '-'.
ENDIF.
ENDDO.
clear offset.
APPEND objline TO objcont.
CLEAR objline.
wa_receiver-rec_type = 'U'.
wa_receiver-com_type = 'INT'.
APPEND wa_receiver TO t_reclist.
* size
DESCRIBE TABLE objcont LINES w_line_count.
READ TABLE objcont INDEX w_line_count INTO objline.
doc_chng-doc_size = ( w_line_count - 1 ) * 255 +
STRLEN( objline ).
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = doc_chng
document_type = 'RAW'
* put_in_outbox = ' '
commit_work = 'X'
TABLES
* object_header = subject
object_content = objcont
receivers = t_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
KR Jaideep, -
Disallow sending External email
Hi, how to configure Exchange 2013 to disallow certain users to send external email
Hi,
As what DareDevil57 mentioned above, we can create a transport rule to meet this requirement.
Here is an article about transport rule for your reference.
Transport Rules:
http://social.technet.microsoft.com/Forums/en-US/dedce6eb-f4b9-42be-b732-dba691b6c284/disallow-sending-external-email?forum=exchangesvradmin
Hope this helps.
Best regards,
Belinda
Belinda Ma
TechNet Community Support -
How to send external email of a Purchase Order
Hello,
I have to send an external email (pdf attachment) of a Purchase Order.
I use the standard sap program: /SMB40/FM06P and the smartform: /SMB40/MMPO_L.
Within transaction NACE I used the following entries:
Medium: 5 (External Send), Program: /SMB40/FM06P, Form routine: ENTRY NEU and Smartform: /SMB40/MMPO_L.
After running transaction ME22n (messages: External Send) I got the following error-messages in processing log:
- Please maintain an output device in your user master data.
- Archiving format not equal to PDF.
Please, can someone help me to solve this problem.
Regards,
Rajeshhi
U need to write the code to convert the smartform to PDF using FM Convert_otf and also for sending mail
The standard program has to be copied to Z and write ur code..to perform u requirements
Check the below links
SO_NEW_DOCUMENT_ATT_SEND_API1
http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/8cd6adbb-0301-0010-39ba-938c601d5db9
Email Invoices to customer as a PDF attachment
surya -
Problems sending an email with a field attached.
Hi everyone,
Im having problems with sending an e-mail (with a field attached) to an external e-mail address.
Im using the followings functions:
<b>'SO_DOCUMENT_INSERT'
'SO_OBJECT_UPLOAD'
'SO_ATTACHMENT_INSERT'
'SO_OBJECT_SEND'</b>
Everything goes well (the functions are executed well), but the message stacks and it isnt be sent.
I can see it with the transaction SBWP, it is in the folder Exit/Documents with status: Waiting communication service .
Then I can send it from there clicking at the button send. And then it is sent.
Have anyone any clue about what Ive missed to do.
I really appreciate your help; I need to solve this problem as soon as possible.
Kind regards.Hai
report zemail no standard page heading line-size 220.
data: message_content like soli occurs 10 with header line,
receiver_list like soos1 occurs 5 with header line,
w_object_hd_change like sood1.
start-of-selection.
Receivers
receiver_list-recextnam = '[email protected]'.
receiver_list-recesc = 'E'.
receiver_list-sndart = 'INT'
receiver_list-sndpri = '1'.
append receiver_list.
General data
w_object_hd_change-objla = sy-langu.
w_object_hd_change-objnam = 'Object name'.
w_object_hd_change-objsns = 'P'.
w_object_hd_change-file_ext = 'HTM'. "<--this is important
Mail subject
w_object_hd_change-objdes = 'HTML from SAP/ABAP'.
Mail body
append 'Message content' to message_content.
append '<b>How''s this for sending HTML E-mail from SAP?</b>' to
message_content.
append '<p>New paragraph</p>' to message_content.
append '<p>Apostrophe’s</p>' to message_content.
Call function to send email - SAPConnect needs to be configured
call function 'SO_OBJECT_SEND'
exporting
object_hd_change = w_object_hd_change
object_type = 'RAW'
owner = sy-uname
tables
objcont = message_content
receivers = receiver_list.
2)
ABAP CODE
Email ITAB structure
DATA: BEGIN OF EMAIL_ITAB OCCURS 10.
INCLUDE STRUCTURE SOLI.
DATA: END OF EMAIL_ITAB.
DATA: T_EMAIL LIKE SOOS1-RECEXTNAM. "EMail distribution list
CONSTANTS: C_EMAIL_DISTRIBUTION LIKE SOOS1-RECEXTNAM VALUE
[email protected],[email protected].
Initialization
REFRESH EMAIL_ITAB.
Populate data
EMAIL_ITAB-LINE = Email body text 1.
APPEND EMAIL_ITAB.
EMAIL_ITAB-LINE = Email body text 2.
APPEND EMAIL_ITAB.
T_EMAIL = C_EMAIL_DISTRIBUTION.
--- EMAIL FUNCTION ---------------------------------------------------
REQUIRMENTS:
1) The user running the program needs a valid email address in their
address portion of tx SU01 under external comms -> SMTP -> internet
address.
2) A job called SAP_EMAIL is running with the following parameters:
Program: RSCONN01 Variant: INT User: XXX
This program moves mail from the outbox to the mail server using
RFC destination: SAP_INTERNET_GATEWAY_SERVER
INTERFACE:
1) APPLICATION: Anything
2) EMAILTITLE: EMail subject
3) RECEXTNAM: EMail distribution lists separated by commas
4) TEXTTAB: Internal table for lines of the email message
EXCEPTIONS:
Send OK = 0 otherwise there was a problem with the send.
CALL FUNCTION 'Z_SEND_EMAIL_ITAB'
EXPORTING
APPLICATION = 'EMAIL'
EMAILTITLE = 'Email Subject'
RECEXTNAM = T_EMAIL
TABLES
TEXTTAB = EMAIL_ITAB
EXCEPTIONS
OTHERS = 1.
Function Z_SEND_EMAIL_ITAB
""Local interface:
*" IMPORTING
*" VALUE(APPLICATION) LIKE SOOD1-OBJNAM
*" VALUE(EMAILTITLE) LIKE SOOD1-OBJDES
*" VALUE(RECEXTNAM) LIKE SOOS1-RECEXTNAM
*" TABLES
*" TEXTTAB STRUCTURE SOLI
*- local data declaration
DATA: OHD LIKE SOOD1,
OID LIKE SOODK,
TO_ALL LIKE SONV-FLAG,
OKEY LIKE SWOTOBJID-OBJKEY.
DATA: BEGIN OF RECEIVERS OCCURS 0.
INCLUDE STRUCTURE SOOS1.
DATA: END OF RECEIVERS.
*- fill odh
CLEAR OHD.
OHD-OBJLA = SY-LANGU.
OHD-OBJNAM = APPLICATION.
OHD-OBJDES = EMAILTITLE.
OHD-OBJPRI = 3.
OHD-OBJSNS = 'F'.
OHD-OWNNAM = SY-UNAME.
*- send Email
CONDENSE RECEXTNAM NO-GAPS.
CHECK RECEXTNAM <> SPACE AND RECEXTNAM CS '@'.
*- for every individual recipient send an Email
(see OSS message 0120050409/0000362105/1999)
WHILE RECEXTNAM CS ','.
PERFORM INIT_REC TABLES RECEIVERS.
READ TABLE RECEIVERS INDEX 1.
RECEIVERS-RECEXTNAM = RECEXTNAM+0(SY-FDPOS).
ADD 1 TO SY-FDPOS.
SHIFT RECEXTNAM LEFT BY SY-FDPOS PLACES.
MODIFY RECEIVERS INDEX 1.
PERFORM SO_OBJECT_SEND_REC
TABLES TEXTTAB RECEIVERS
USING OHD.
ENDWHILE.
*- check last recipient in recipient list
IF RECEXTNAM <> SPACE.
PERFORM INIT_REC TABLES RECEIVERS.
READ TABLE RECEIVERS INDEX 1.
RECEIVERS-RECEXTNAM = RECEXTNAM.
MODIFY RECEIVERS INDEX 1.
PERFORM SO_OBJECT_SEND_REC
TABLES TEXTTAB RECEIVERS
USING OHD.
ENDIF.
ENDFUNCTION.
FORM SO_OBJECT_SEND_REC *
FORM SO_OBJECT_SEND_REC
TABLES OBJCONT STRUCTURE SOLI
RECEIVERS STRUCTURE SOOS1
USING OBJECT_HD STRUCTURE SOOD1.
DATA: OID LIKE SOODK,
TO_ALL LIKE SONV-FLAG,
OKEY LIKE SWOTOBJID-OBJKEY.
CALL FUNCTION 'SO_OBJECT_SEND'
EXPORTING
EXTERN_ADDRESS = 'X'
OBJECT_HD_CHANGE = OBJECT_HD
OBJECT_TYPE = 'RAW'
OUTBOX_FLAG = 'X'
SENDER = SY-UNAME
IMPORTING
OBJECT_ID_NEW = OID
SENT_TO_ALL = TO_ALL
OFFICE_OBJECT_KEY = OKEY
TABLES
OBJCONT = OBJCONT
RECEIVERS = RECEIVERS
EXCEPTIONS
ACTIVE_USER_NOT_EXIST = 1
COMMUNICATION_FAILURE = 2
COMPONENT_NOT_AVAILABLE = 3
FOLDER_NOT_EXIST = 4
FOLDER_NO_AUTHORIZATION = 5
FORWARDER_NOT_EXIST = 6
NOTE_NOT_EXIST = 7
OBJECT_NOT_EXIST = 8
OBJECT_NOT_SENT = 9
OBJECT_NO_AUTHORIZATION = 10
OBJECT_TYPE_NOT_EXIST = 11
OPERATION_NO_AUTHORIZATION = 12
OWNER_NOT_EXIST = 13
PARAMETER_ERROR = 14
SUBSTITUTE_NOT_ACTIVE = 15
SUBSTITUTE_NOT_DEFINED = 16
SYSTEM_FAILURE = 17
TOO_MUCH_RECEIVERS = 18
USER_NOT_EXIST = 19
X_ERROR = 20
OTHERS = 21.
IF SY-SUBRC <> 0.
RAISE OTHERS.
ENDIF.
ENDFORM.
FORM INIT_REC *
FORM INIT_REC TABLES RECEIVERS STRUCTURE SOOS1.
CLEAR RECEIVERS.
REFRESH RECEIVERS.
MOVE SY-DATUM TO RECEIVERS-RCDAT .
MOVE SY-UZEIT TO RECEIVERS-RCTIM.
MOVE '1' TO RECEIVERS-SNDPRI.
MOVE 'X' TO RECEIVERS-SNDEX.
MOVE 'U-' TO RECEIVERS-RECNAM.
MOVE 'U' TO RECEIVERS-RECESC.
MOVE 'INT' TO RECEIVERS-SNDART.
MOVE '5' TO RECEIVERS-SORTCLASS.
APPEND RECEIVERS.
ENDFORM.
3)
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
DATA L_NUM(3).
Creation of the document to be sent
File Name
DOC_CHNG-OBJ_NAME = 'SENDFILE'.
Mail Subject
DOC_CHNG-OBJ_DESCR = 'Delivered Mail'.
Mail Contents
OBJTXT = 'Object text'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
Creation of the document attachment
LOOP AT ITAB_DATA.
CONCATENATE ITAB_DATA-PRODUCTOR
ITAB_DATA-VBELN
ITAB_DATA-POSNR
ITAB_DATA-MATNR INTO OBJBIN.
APPEND OBJBIN.
ENDLOOP.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'ORDERS'.
APPEND OBJHEAD.
Creation of the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'TXT'.
OBJPACK-OBJ_NAME = 'WEBSITE'.
OBJPACK-OBJ_DESCR = 'ORDERS.TXT'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK.
Completing the recipient list
target recipent
clear RECLIST.
RECLIST-RECEIVER = '[email protected]'.
RECLIST-EXPRESS = 'X'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
copy recipents
clear RECLIST.
RECLIST-RECEIVER = '[email protected]'.
RECLIST-EXPRESS = 'X'.
RECLIST-REC_TYPE = 'U'.
RECLIST-COPY = 'X'.
APPEND RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
ENDFORM. " SEND_MAIL
Thanks & Regards
Sreeni -
Problem sending out email on iPhone 3GS
Hi,
I'm having problem sending email on my iPhone 3GS today only. Error "Cannot send Mail: an error occurred while delivering this message." WiFi is off; Turn on all the SMTP to Yahoo and Gmail; I have powered it off and on again, still my email are not sending out.
Help...~Ya - I am have the same problem. I have 4 accounts that are set-up on my phone. 3 Gmail - I can receive but not send out replies - all settings are matched up with gmail sever information. I have 1 Yahoo account which I can send and receive from no problem. Why??
Maybe you are looking for
-
Iam trying to reinstall the OS X after erasing the hard disc but it can't be completed it says u need to visit the purchase page ??? I tried many time to download it any help
-
Microsoft apps for Belle in Croatia
When will Microsoft apps for Belle be available in Croatia? Thank you!
-
How to listen to key press in JTable
I've been trying to listen to key press in JTable, However it only works if the cell is double-clicked. If the tab button is use or the cell is single-clicked, nothing happens to the listener. Anybody can help me??? Thanks
-
Configuration of Output Type within Inventory Management
Hi Experts, I am on ECC 5.0 and have a following requirement. I need to create a output type for printing the material documents. There is a requirement that, newly created output type should be only used by given Company code and Plants under it. In
-
So, I use my ipad strictly for school. The new iOS7 has made it extremely difficult to select my own background and get it into view. I want to take a picture of my weekly schedule and make it my background, but the iOS7 is insisting on scaling my