URGENT:Dynamically sending email
hi,
I created an application,in which iam having two input fields.If i entered the email id in 1st input field and person name in other input field,then Email should open .In that the to:should be the email id and the person name should be written in text.So pease reply as quick as possible.
>
Micky Oestreich wrote:
> Do you want to start an email client / application like MS Outlook, or do you want to send the email via SAP, which is the 'standard' way of doing so. For the latter option have a look at this blog (with very good explanation):
>
> [Blog: sending email from abap|/people/thomas.jung3/blog/2004/09/09/receiving-e-mail-and-processing-it-with-abap--version-610-and-higher]
Actually that is the receiving Email blog. There is the one for sending email:
[/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface|/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface]
You won't be able to open Outlook from Web Dynpro. The blog above shows you how to configure and then code the email sending process. If you want a screen to popup showing the email address and letting the person type the email (like they would if you could open Outlook), you would need to code that yourself in WDA.
>So pease reply as quick as possible.
That really isn't necessary or even polite to say on the forums. People are going to respond when the can.
Similar Messages
-
Urgent: Regarding Sending Email Notifications
Hi all,
We have scenario in which we have to search those users who has not accessed their accounts from last 2 years and then send them an email notification and after one month of notificatio we have to search those users who have been notified but yet not accessed their account and delete those accounts from LDAP.
For this we are using JNDI to search users. Now we are facing two problems:
1. The users email ids are in the form of List. When we refer this list in To address of Email Template then it gives us an exception: Saying that service not responding, No recepient addresses while in case of hard coded values it runs successfully. I think this is due to that it requires a semicolon(;) seperated list to send email notification. Thats why we thought that we have to use some looping to send the notifications to one user at a time. But if there is any other solution, please suggest.
2. For the scenario of the users to be deleted, how will we come to know whether after two years the users have been notified successfully??
This is really urgent. Please suggest any idea regarding the above issues.
Thanks & Regards
Gaurav JainThe way to do it would be to put your human task inside a while loop. This while loop would set a variable to the approver's userid and would continue till all the four approve it. In your human task you need just one approver and that would be the variable which the while loop sets.
If you do it this way, then you can use the OOTB notification tab in the .task and select the 'Assignee' as the email notification receiver and you won't have to worry about getting the email ids as well.
As for the current approach which you have, that is of using the sequential approvers in the human task, I haven't tried it, but just try setting the notification tab in the .task to 'Assignee' and event 'On Assignment'. That should do it as well.
-Bikash -
Using BI publisher to send alert to dynamically generated email
Hello,
Good afternoon.
Please I will like to know if its possible to use Oracle BI publisher to send alert to dynamically generated email in real time online basis ?
If yes please can I have an idea of how this can be achieved ?Hi,
Go through this...http://oraclebizint.wordpress.com/2008/02/01/oracle-bi-ee-101332-calling-bi-publisher-java-apis-from-ibots-storing-reports-in-file-system-using-delivers-and-bi-publisher-scheduler/
Regards,
Srikanth -
How to send email notification in different languages in Workflow ?? Urgent Help Needed
Gurus,
How to send email notification in different languages in Workflow? Can anyone send me some useful guidelines or link where it is mentioned.There is no profile option available to specify whether send or not send email notification.
But after login, in preferences youcan set the notification preference value by which you can configure whether to send or not
to send email notifications.
If you select ''Do not send me mail' or 'Disabled' it will not send.
For other values it sends the notfication in different formats like text, html, attachments etc...
Edited by: sarojak on Jun 27, 2011 7:18 AM -
Error while sending email to external mail - Urgent
Hi All,
I am getting error while sending email with attachement. The Error code is 02.
I am not able to identify the error. bold Please help me in solving this problem.
Is it anything wrong with the code or Any Configuration with SCOT/SOST.bold
the code i am using is :
REPORT YVR_F MESSAGE-ID XX .
TABLES : EDIDC, EDIDS, EDPAR.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS : P_STATUS LIKE EDIDC-STATUS DEFAULT '51'.
SELECT-OPTIONS : S_DIRECT FOR EDIDC-DIRECT,
S_MESTYP FOR EDIDC-MESTYP,
S_CREDAT FOR EDIDC-CREDAT.
SELECTION-SCREEN END OF BLOCK B1 .
PARAMETER: P_EMAIL LIKE SOMLRECI1-RECEIVER,
P_SENDER LIKE SOMLRECI1-RECEIVER no-display,
P_DELSPL AS CHECKBOX,
P_ONLINE NO-DISPLAY.
DATA : TB_EDIDC LIKE STANDARD TABLE OF EDIDC INITIAL SIZE 0 WITH HEADER
LINE.
DATA : TB_EDPAR LIKE STANDARD TABLE OF EDPAR INITIAL SIZE 0 WITH HEADER
LINE.
DATA : TB_KNA1 LIKE STANDARD TABLE OF KNA1 INITIAL SIZE 0 WITH HEADER
LINE.
DATA : TB_ADRC LIKE STANDARD TABLE OF ADRC INITIAL SIZE 0 WITH HEADER
LINE.
DATA: INT_PDF TYPE TABLE OF TLINE WITH HEADER LINE.
DATA : BEGIN OF TB_ED OCCURS 0,
SNDPRN LIKE EDIDC-SNDPRN,
LOC LIKE ADRC-BUILDING,
DOCNUM LIKE EDIDC-DOCNUM,
IDOCTP LIKE EDIDC-IDOCTP,
MESTYP LIKE EDIDC-MESTYP,
DIRECT LIKE EDIDC-DIRECT,
CREDAT LIKE EDIDC-CREDAT,
STATUS LIKE EDIDC-STATUS,
END OF TB_ED.
DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
WITH HEADER LINE.
Job Runtime Parameters
DATA: GD_EVENTID LIKE TBTCM-EVENTID,
GD_EVENTPARM LIKE TBTCM-EVENTPARM,
GD_EXTERNAL_PROGRAM_ACTIVE LIKE TBTCM-XPGACTIVE,
GD_JOBCOUNT LIKE TBTCM-JOBCOUNT,
GD_JOBNAME LIKE TBTCM-JOBNAME,
GD_STEPCOUNT LIKE TBTCM-STEPCOUNT,
GD_ERROR TYPE SY-SUBRC,
GD_RECIEVER TYPE SY-SUBRC.
DATA: W_RECSIZE TYPE I,
W_SPOOL_NR LIKE SY-SPONO.
%_print LIKE pri_params.
DATA: GD_SUBJECT LIKE SODOCCHGI1-OBJ_DESCR,
IT_MESS_BOD LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
IT_MESS_ATT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
GD_SENDER_TYPE LIKE SOEXTRECI1-ADR_TYP,
GD_ATTACHMENT_DESC TYPE SO_OBJ_NAM,
GD_ATTACHMENT_NAME TYPE SO_OBJ_DES.
Spool to PDF conversions
DATA: GD_SPOOL_NR LIKE TSP01-RQIDENT,
GD_DESTINATION LIKE RLGRAP-FILENAME,
GD_BYTECOUNT LIKE TST01-DSIZE,
GD_BUFFER TYPE STRING.
Binary store for PDF
DATA: BEGIN OF IT_PDF_OUTPUT OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF IT_PDF_OUTPUT.
DATA: GD_RECSIZE TYPE I.
CONSTANTS: C_DEV LIKE SY-SYSID VALUE 'DEV',
C_NO(1) TYPE C VALUE ' ',
C_DEVICE(4) TYPE C VALUE 'LOCL'.
DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
W_CNT TYPE I,
W_SENT_ALL(1) TYPE C,
W_DOC_DATA LIKE SODOCCHGI1.
DATA : MSTR_PRINT_PARMS LIKE PRI_PARAMS,
MC_VALID,
P_REPID LIKE SY-REPID,
WF_ID LIKE TSP01-RQIDENT,
LOC_BYTECOUNT TYPE I.
*start-of-selection.
MSTR_PRINT_PARMS-PDEST = 'LOCL'.
P_REPID = SY-REPID.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
authority= ' '
COPIES = '1'
COVER_PAGE = SPACE
DATA_SET = SPACE
DEPARTMENT = SPACE
DESTINATION = 'LP01'
EXPIRATION = '1'
IMMEDIATELY = 'X'
LAYOUT = 'X_65_132'
MODE = SPACE
NEW_LIST_ID = 'X'
NO_DIALOG = 'X'
USER = SY-UNAME
IMPORTING
OUT_PARAMETERS = MSTR_PRINT_PARMS
VALID = MC_VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
SUBMIT (P_REPID) TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS MSTR_PRINT_PARMS.
AND RETURN.
NEW-PAGE PRINT ON NO DIALOG PARAMETERS
MSTR_PRINT_PARMS.
perform data.
NEW-PAGE PRINT OFF. "This marks the end of the screen for which the
*SPOOL NO WAS GENERATED.
WF_ID = SY-SPONO.
*converting spool to pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = WF_ID "SPOOL NUMBER
NO_DIALOG = SPACE
PDF_DESTINATION = 'X'
IMPORTING
PDF_BYTECOUNT =
LOC_BYTECOUNT "NUMBER OF BYTES TRANSFERRED
TABLES
PDF = INT_PDF "TABLE FOR PDF REPORT
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12.
*CALL FUNCTION 'DOWNLOAD'
*EXPORTING
*bin_filesize = loc_bytecount "NO. OF BYTES
*filename = 'C:/EMAILPDF.PDF'
*filetype = 'BIN'
**IMPORTING
**act_filename = loc_filename
*TABLES
*data_tab = int_pdf.
IF P_DELSPL EQ 'X'.
PERFORM DELETE_SPOOL.
ENDIF.
Transfer the 132-long strings to 255-long strings
LOOP AT INT_PDF.
TRANSLATE INT_PDF USING ' ~'.
CONCATENATE GD_BUFFER INT_PDF INTO GD_BUFFER.
ENDLOOP.
TRANSLATE GD_BUFFER USING '~ '.
DO.
IT_MESS_ATT = GD_BUFFER.
APPEND IT_MESS_ATT.
SHIFT GD_BUFFER LEFT BY 255 PLACES.
IF GD_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
DESCRIBE TABLE IT_MESS_ATT LINES GD_RECSIZE.
CHECK GD_RECSIZE > 0.
PERFORM SENDMAIL USING P_EMAIL..
*& Form sendmail
text
--> p1 text
<-- p2 text
FORM SENDMAIL USING P_EMAIL.
CHECK NOT ( P_EMAIL IS INITIAL ).
REFRESH IT_MESS_BOD.
Default subject matter
GD_SUBJECT = 'Subject'.
GD_ATTACHMENT_DESC = 'IDOC LIST'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
IT_MESS_BOD = 'List Of Failed Idocs'.
APPEND IT_MESS_BOD.
IT_MESS_BOD = 'List Of Failed Idocs'.
APPEND IT_MESS_BOD.
If no sender specified - default blank
IF P_SENDER EQ SPACE.
GD_SENDER_TYPE = SPACE.
ELSE.
GD_SENDER_TYPE = 'INT'.
ENDIF.
Send file by email as .xls speadsheet
PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES IT_MESS_BOD
IT_MESS_ATT
USING P_EMAIL
'Document attachment'
'PDF'
GD_ATTACHMENT_NAME
GD_ATTACHMENT_DESC
P_SENDER
GD_SENDER_TYPE
CHANGING GD_ERROR
GD_RECIEVER.
ENDFORM. " sendmail
*& Form DELETE_SPOOL
text
--> p1 text
<-- p2 text
FORM DELETE_SPOOL.
DATA: LD_SPOOL_NR TYPE TSP01_SP0R-RQID_CHAR.
LD_SPOOL_NR = WF_ID. "GD_SPOOL_NR.
CHECK P_DELSPL <> C_NO.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
SPOOLID = LD_SPOOL_NR.
ENDFORM. " DELETE_SPOOL
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
text
-->P_IT_MESS_BOD text
-->P_IT_MESS_ATT text
-->P_P_EMAIL text
-->P_0846 text
-->P_0847 text
-->P_GD_ATTACHMENT_NAME text
-->P_GD_ATTACHMENT_DESC text
-->P_P_SENDER text
-->P_GD_SENDER_TYPE text
<--P_GD_ERROR text
<--P_GD_RECIEVER text
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES IT_MESSAGE
IT_ATTACH
USING P_EMAIL
P_MTITLE
P_FORMAT
P_FILENAME
P_ATTDESCRIPTION
P_SENDER_ADDRESS
P_SENDER_ADDRES_TYPE
CHANGING P_ERROR
P_RECIEVER.
DATA: LD_ERROR TYPE SY-SUBRC,
LD_RECIEVER TYPE SY-SUBRC,
LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
LD_EMAIL LIKE SOMLRECI1-RECEIVER,
LD_FORMAT TYPE SO_OBJ_TP ,
LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
LD_ATTFILENAME TYPE SO_OBJ_DES ,
LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
LD_RECEIVER LIKE SY-SUBRC.
DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
W_CNT TYPE I,
W_SENT_ALL(1) TYPE C,
W_DOC_DATA LIKE SODOCCHGI1.
LD_EMAIL = P_EMAIL.
LD_MTITLE = P_MTITLE.
LD_FORMAT = P_FORMAT.
LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
LD_ATTFILENAME = P_FILENAME.
LD_SENDER_ADDRESS = P_SENDER.
LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
Fill the document data.
W_DOC_DATA-DOC_SIZE = 1.
Populate the subject/generic message attributes
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE .
W_DOC_DATA-SENSITIVTY = 'F'.
Fill the document data and get size of attachment
CLEAR W_DOC_DATA.
READ TABLE IT_ATTACH INDEX W_CNT.
W_DOC_DATA-DOC_SIZE =
( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
W_DOC_DATA-OBJ_LANGU = SY-LANGU.
W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
W_DOC_DATA-SENSITIVTY = 'F'.
CLEAR T_ATTACHMENT.
REFRESH T_ATTACHMENT.
T_ATTACHMENT[] = IT_ATTACH[].
Describe the body of the message
CLEAR T_PACKING_LIST.
REFRESH T_PACKING_LIST.
T_PACKING_LIST-TRANSF_BIN = SPACE.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 0.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE IT_MESSAGE LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = 'RAW'.
APPEND T_PACKING_LIST.
Create attachment notification
T_PACKING_LIST-TRANSF_BIN = 'X'.
T_PACKING_LIST-HEAD_START = 1.
T_PACKING_LIST-HEAD_NUM = 1.
T_PACKING_LIST-BODY_START = 1.
DESCRIBE TABLE T_ATTACHMENT LINES T_PACKING_LIST-BODY_NUM.
T_PACKING_LIST-DOC_TYPE = LD_FORMAT.
T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
T_PACKING_LIST-DOC_SIZE = T_PACKING_LIST-BODY_NUM * 255.
APPEND T_PACKING_LIST.
Add the recipients email address
CLEAR T_RECEIVERS.
REFRESH T_RECEIVERS.
T_RECEIVERS-RECEIVER = p_EMAIL.
T_RECEIVERS-REC_TYPE = 'U'.
T_RECEIVERS-COM_TYPE = 'INT'.
T_RECEIVERS-NOTIF_DEL = 'X'.
T_RECEIVERS-NOTIF_NDEL = 'X'.
APPEND T_RECEIVERS.
DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
W_SENT_ALL = 'X'.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = W_DOC_DATA
PUT_IN_OUTBOX = 'X'
SENDER_ADDRESS = LD_SENDER_ADDRESS
SENDER_ADDRESS_TYPE = LD_SENDER_ADDRESS_TYPE
COMMIT_WORK = 'X'
IMPORTING
SENT_TO_ALL = W_SENT_ALL
TABLES
PACKING_LIST = T_PACKING_LIST
object_header = objhead
CONTENTS_BIN = T_ATTACHMENT
CONTENTS_TXT = IT_MESSAGE
RECEIVERS = T_RECEIVERS
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
IF SY-SUBRC NE 0.
MESSAGE E000 WITH 'Error occurred while sending'.
ELSE.
MESSAGE I000 WITH 'The document was sent'.
ENDIF.
ENDFORM. " SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form data
text
--> p1 text
<-- p2 text
FORM data.
SELECT SNDPRN
DOCNUM
IDOCTP
MESTYP
DIRECT
CREDAT
STATUS
FROM EDIDC
INTO CORRESPONDING FIELDS
OF TABLE TB_EDIDC
WHERE STATUS = P_STATUS
AND MESTYP IN S_MESTYP
AND DIRECT IN S_DIRECT
AND CREDAT IN S_CREDAT.
SELECT KUNNR
INPNR
FROM EDPAR
INTO CORRESPONDING FIELDS
OF TABLE TB_EDPAR
FOR ALL ENTRIES IN TB_EDIDC
WHERE KUNNR = TB_EDIDC-SNDPRN.
SELECT KUNNR
ADRNR
FROM KNA1
INTO CORRESPONDING FIELDS
OF TABLE TB_KNA1
FOR ALL ENTRIES IN TB_EDPAR
WHERE KUNNR = TB_EDPAR-INPNR.
SELECT ADDRNUMBER
BUILDING
FROM ADRC
INTO CORRESPONDING FIELDS
OF TABLE TB_ADRC
FOR ALL ENTRIES IN TB_KNA1
WHERE ADDRNUMBER = TB_KNA1-ADRNR.
LOOP AT TB_EDIDC WHERE STATUS = P_STATUS
AND MESTYP IN S_MESTYP
AND DIRECT IN S_DIRECT
AND CREDAT IN S_CREDAT.
TB_ED-SNDPRN = TB_EDIDC-SNDPRN.
TB_ED-DOCNUM = TB_EDIDC-DOCNUM.
TB_ED-IDOCTP = TB_EDIDC-IDOCTP.
TB_ED-MESTYP = TB_EDIDC-MESTYP.
TB_ED-DIRECT = TB_EDIDC-DIRECT.
TB_ED-CREDAT = TB_EDIDC-CREDAT.
TB_ED-STATUS = TB_EDIDC-STATUS.
READ TABLE TB_EDPAR WITH KEY KUNNR = TB_EDIDC-SNDPRN.
READ TABLE TB_KNA1 WITH KEY KUNNR = TB_EDPAR-INPNR.
READ TABLE TB_ADRC WITH KEY ADDRNUMBER = TB_KNA1-ADRNR.
TB_ED-LOC = TB_ADRC-BUILDING.
APPEND TB_ED.
ENDLOOP.
WRITE :/02 'CustomerNo',
15 'Location Code',
30 'Idoc Number',
55 'Basic Type',
70 'Message Type',
95 'Direction',
110 'Received Date',
130 'Status'.
ULINE.
LOOP AT TB_ED.
WRITE :/02 TB_ED-SNDPRN,
15 TB_ED-LOC,
30 TB_ED-DOCNUM,
55 TB_ED-IDOCTP,
70 TB_ED-MESTYP,
95 TB_ED-DIRECT,
110 TB_ED-CREDAT,
130 TB_ED-STATUS.
ENDLOOP.
ENDFORM. " data
Kindly help me in solving the issue.
Thanks in advance.
Suki.Hi,
Check in transaction SCOT. If your mail is in error status in SCOT, you can assure that there is no problem with your code. If your message has not reached till SCOT, then the problem will be with the code.
If the mail is there in scot with error status tell the BASIS to configure it. I feel this could be the problem.
Regards,
Renjith Michael. -
Sending email notifications in oim 11g approval flow dynamically
Hi,
I have 4 level approval workflow in oim 11g and developed custom composite to get all the approver ids and and assigning these ids into 4 variables.
And used these variables in my custom 4 level sequential workflow. This workflow is working fine. Now I need to update this composite to send email notifications to the approver. So updated code to retrieve email ids and to store them in 4 more vairables. I cannot send all emails at a time thru the code. I need to send email only to the corresponding approver only when the flow reaches to that particular level.
Subject and body will be same but the email address will vary.
Can you please let me know the step by step process to implement notifications to these many levels.
If you think, this is not correct approach (storing all email ids in variables and then sending notifications), please let me know correct approach.
Thanks,
MaryThe way to do it would be to put your human task inside a while loop. This while loop would set a variable to the approver's userid and would continue till all the four approve it. In your human task you need just one approver and that would be the variable which the while loop sets.
If you do it this way, then you can use the OOTB notification tab in the .task and select the 'Assignee' as the email notification receiver and you won't have to worry about getting the email ids as well.
As for the current approach which you have, that is of using the sequential approvers in the human task, I haven't tried it, but just try setting the notification tab in the .task to 'Assignee' and event 'On Assignment'. That should do it as well.
-Bikash -
Hi all,
i am planning to send an email from abap
To [email protected]
Subject: Mail from ABAP
text: example mail from an abap program
<b>How to aproach that?
Give me a Clear Idea.
which function modules to use?
which Structures to Use?</b>try this Program.
TABLES: ekko.
PARAMETERS: p_email TYPE somlreci1-receiver
DEFAULT '[email protected]'.
TYPES: BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
END OF t_ekpo.
DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
wa_ekpo TYPE t_ekpo.
TYPES: BEGIN OF t_charekpo,
ebeln(10) TYPE c,
ebelp(5) TYPE c,
aedat(8) TYPE c,
matnr(18) TYPE c,
END OF t_charekpo.
DATA: wa_charekpo TYPE t_charekpo.
DATA: it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
WITH HEADER LINE.
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c,
w_doc_data LIKE sodocchgi1,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
*START_OF_SELECTION
START-OF-SELECTION.
Retrieve sample data from table ekpo
PERFORM data_retrieval.
Populate table with detaisl to be entered into .xls file
PERFORM build_xls_data_table.
*END-OF-SELECTION
END-OF-SELECTION.
Populate message body text
perform populate_email_message_body.
Send file by email as .xls speadsheet
PERFORM send_file_as_email_attachment
tables it_message
it_attach
using p_email
'Example .xls documnet attachment'
'XLS'
'filename'
changing gd_error
gd_reciever.
Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM initiate_mail_execute_program.
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp aedat matnr
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekpo.
ENDFORM. " DATA_RETRIEVAL
*& Form BUILD_XLS_DATA_TABLE
Build data table for .xls document
FORM build_xls_data_table.
CONSTANTS: con_cret TYPE x VALUE '0D', "OK for non Unicode
con_tab TYPE x VALUE '09'. "OK for non Unicode
*If you have Unicode check active in program attributes thnen you will
*need to declare constants as follows
*class cl_abap_char_utilities definition load.
*constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF.
CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
LOOP AT it_ekpo INTO wa_charekpo.
CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
wa_charekpo-aedat wa_charekpo-matnr
INTO it_attach SEPARATED BY con_tab.
CONCATENATE con_cret it_attach INTO it_attach.
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
FORM send_file_as_email_attachment tables pit_message
pit_attach
using p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
changing p_error
p_reciever.
DATA: ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver,
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
ld_email = p_email.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
Fill the document data.
w_doc_data-doc_size = 1.
Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
t_receivers-receiver = ld_email.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
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.
Populate zerror return code
ld_error = sy-subrc.
Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM.
*& Form INITIATE_MAIL_EXECUTE_PROGRAM
Instructs mail send program for SAPCONNECT to send email.
FORM initiate_mail_execute_program.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
*& Form POPULATE_EMAIL_MESSAGE_BODY
Populate message body text
form populate_email_message_body.
REFRESH it_message.
it_message = 'Please find attached a list test ekpo records'.
APPEND it_message.
endform. " POPULATE_EMAIL_MESSAGE_BODY
Regards
Abhishek -
Cannot send email from WD Java
hi Experts,
I have created an email WD Java Application, this application sends an email to the users on click of a button.
My Problem is this application runs well on SP11, but we have upgraded our dev portal to SP14.
On SP14 mail is not send. Please help its really very urgent.
I am pasting the code used for sending email.
wdContext.currentEmailElement().setFrom(wdContext.currentContextElement().getEmpMailID());
wdContext.currentEmailElement().setCc("");
wdContext.currentEmailElement().setBcc("");
wdContext.currentEmailElement().setSubject("Personal Travel Request.");
wdContext.currentEmailElement().setTo("[email protected]");
Properties props = new Properties();
String host = "rmail070.zmail.ril.com";
props.put("rmail070.zmail.ril.com", host);
Session session = Session.getInstance(props, null);
MimeMessage message = new MimeMessage(session);
Address toAddress = new InternetAddress();
Address fromAddress = new InternetAddress();
Address ccAddress = new InternetAddress();
Address bccAddress = new InternetAddress();
try
/* Creates an email object with different parts, one for the
text and another for the attached file */
MimeMultipart multipart = new MimeMultipart();
BodyPart messageBodyPart = new MimeBodyPart();
/* the following statements build up the email */
if (! wdContext.currentEmailElement().getFrom().equals(""))
fromAddress = new InternetAddress(wdContext.currentEmailElement().getFrom());
message.setFrom(fromAddress);
} if (! wdContext.currentEmailElement().getTo().equals(""))
toAddress = new InternetAddress(wdContext.currentEmailElement().getTo());
message.setRecipient(Message.RecipientType.TO,toAddress);
if (! wdContext.currentEmailElement().getCc().equals(""))
ccAddress = new InternetAddress(wdContext.currentEmailElement().getCc());
message.setRecipient(Message.RecipientType.CC,ccAddress);
if (! wdContext.currentEmailElement().getBcc().equals(""))
bccAddress = new InternetAddress(wdContext.currentEmailElement().getBcc());
message.setRecipient(Message.RecipientType.BCC,bccAddress);
if (!wdContext.currentEmailElement().getSubject().equals(""))
message.setSubject(wdContext.currentEmailElement().getSubject());
if (! wdContext.currentEmailElement().getBody().equals(""))
messageBodyPart.setText(wdContext.currentEmailElement().getBody());
multipart.addBodyPart(messageBodyPart);
/* a new part will be added, in the complete email this will
be the attachment */
messageBodyPart = new MimeBodyPart();
// try{
// String filename =WDURLGenerator.getResourcePath(wdComponentAPI.getDeployableObjectPart(),"test.pdf");
// DataSource source = new FileDataSource(filename);
// messageBodyPart.setDataHandler(new DataHandler(source));
// messageBodyPart.setFileName(source.getName());
// messageBodyPart.setHeader("Content-Type","application/pdf");
// multipart.addBodyPart(messageBodyPart);
message.setContent(multipart);
Transport.send(message);
// catch(WDAliasResolvingException e)
// e.getMessage();
catch (AddressException e)
wdComponentAPI.getMessageManager().reportWarning(e.
getLocalizedMessage());
e.printStackTrace();
catch (SendFailedException e)
wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
e.printStackTrace();
catch (MessagingException e)
wdComponentAPI.getMessageManager().reportWarning(e.getLocalizedMessage());
e.printStackTrace();
Points will be rewarded to helpful answers.
Regards,
Sanjyoti.Hi,
see this link it will be helpful for u
[http://help.sap.com/saphelp_nw04/helpdata/en/f7/f289c67c759a41b570890c62a03519/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/f7/f289c67c759a41b570890c62a03519/content.htm]
regards
Hazrath -
Sending email using utl_mail
Hi all,
I am able to successfully send email from database (11.2.0.1) using utl_mail package.
exec utl_mail.send(sender=>'[email protected]', recipients=> '[email protected]', message=>'YOU HAVE ONE MONTH TO RENEW CONTRACT', subject=>'YOU HAVE ONE MONTH TO RENEW CONTRACT') ;but the requirement is such that i have to send email trigger to only the employees who's contract is ending in a week, how can i dynamically put the email of teh employee in the recipients tag in utl_mail.send.
ex:- something like below, i know teh code isn't right but kindly guide me
exec utl_mail.send(sender=>'[email protected]', recipients=> 'select email from emp where contract_exp between sysdate and sysdate+7 ' , message=>'YOU HAVE ONE MONTH TO RENEW CONTRACT', subject=>'YOU HAVE ONE MONTH TO RENEW CONTRACT') ;thank youuser10243788 wrote:
Hi all,
I am able to successfully send email from database (11.2.0.1) using utl_mail package.
exec utl_mail.send(sender=>'[email protected]', recipients=> '[email protected]', message=>'YOU HAVE ONE MONTH TO RENEW CONTRACT', subject=>'YOU HAVE ONE MONTH TO RENEW CONTRACT') ;but the requirement is such that i have to send email trigger to only the employees who's contract is ending in a week, how can i dynamically put the email of teh employee in the recipients tag in utl_mail.send.
ex:- something like below, i know teh code isn't right but kindly guide me
exec utl_mail.send(sender=>'[email protected]', recipients=> 'select email from emp where contract_exp between sysdate and sysdate+7 ' , message=>'YOU HAVE ONE MONTH TO RENEW CONTRACT', subject=>'YOU HAVE ONE MONTH TO RENEW CONTRACT') ;thank youput SELECT from above within LOOP -
Sending email using UTL_SMTP
Dear experts,
I am trying to send an email using UTL_SMTP (i switched from UTL_MAIL to UTL_SMTP since i need to send mails with large attachments - BLOB). I am using the demo_mail package given here:
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/Utl_Smtp_Sample.html
While running the program I am getting an error message (from the error.log) saying:
[Mon Aug 04 14:00:21 2008] [error] [client 192.168.0.7] mod_plsql: /ns/email_p.send HTTP-404 ORA-29279: SMTP permanent error: 530 5.7.0 Must issue a STARTTLS command first. 9sm12723808qbw.6\nORA-06512: at "SYS.UTL_SMTP", line 20\nORA-06512: at "SYS.UTL_SMTP", line 98\nORA-06512: at "SYS.UTL_SMTP", line 221\nORA-06512: at "NEXTSTEP.SEND_EMAIL_HELPER", line 258\nORA-06512: at "NEXTSTEP.SEND_EMAIL_HELPER", line 119\nORA-06512: at "NEXTSTEP.EMAIL_P", line 33\nORA-06512: at line 31\n, referer: file:///C:/Documents and Settings/Mayank/My Documents/Flex Builder 3/ns5/bin-debug/main.swf
My code is as follows:
PACKAGE DECLARATION. This is the DEMO_MAIL package posted under above link (I have renamed it).
CREATE OR REPLACE PACKAGE NEXTSTEP.send_email_helper IS
----------------------- Customizable Section -----------------------
-- Customize the SMTP host, port and your domain name below.
smtp_host VARCHAR2(256) := 'smtp.gmail.com';
smtp_port PLS_INTEGER := 587;
smtp_domain VARCHAR2(256) := null;
-- Customize the signature that will appear in the email's MIME header.
-- Useful for versioning.
MAILER_ID CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
--------------------- End Customizable Section ---------------------
-- A unique string that demarcates boundaries of parts in a multi-part email
-- The string should not appear inside the body of any part of the email.
-- Customize this if needed or generate this randomly dynamically.
BOUNDARY CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';
FIRST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
LAST_BOUNDARY CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
utl_tcp.CRLF;
-- A MIME type that denotes multi-part email (MIME) messages.
MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
BOUNDARY || '"';
MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER := 76 / 4 * 3;
-- A simple email API for sending email in plain text in a single call.
-- The format of an email address is one of these:
-- someone@some-domain
-- "Someone at some domain" <someone@some-domain>
-- Someone at some domain <someone@some-domain>
-- The recipients is a list of email addresses separated by
-- either a "," or a ";"
PROCEDURE mail(sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2);
-- Extended email API to send email in HTML or plain text with no size limit.
-- First, begin the email by begin_mail(). Then, call write_text() repeatedly
-- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
-- email in non-ASCII or multi-byte character set. End the email with
-- end_mail().
FUNCTION begin_mail(sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
priority IN PLS_INTEGER DEFAULT NULL)
RETURN utl_smtp.connection;
-- Write email body in ASCII
PROCEDURE write_text(conn IN OUT NOCOPY utl_smtp.connection,
message IN VARCHAR2);
-- Write email body in non-ASCII (including multi-byte). The email body
-- will be sent in the database character set.
PROCEDURE write_mb_text(conn IN OUT NOCOPY utl_smtp.connection,
message IN VARCHAR2);
-- Write email body in binary
PROCEDURE write_raw(conn IN OUT NOCOPY utl_smtp.connection,
message IN RAW);
-- APIs to send email with attachments. Attachments are sent by sending
-- emails in "multipart/mixed" MIME format. Specify that MIME format when
-- beginning an email with begin_mail().
-- Send a single text attachment.
PROCEDURE attach_text(conn IN OUT NOCOPY utl_smtp.connection,
data IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
last IN BOOLEAN DEFAULT FALSE);
-- Send a binary attachment. The attachment will be encoded in Base-64
-- encoding format.
PROCEDURE attach_base64(conn IN OUT NOCOPY utl_smtp.connection,
data IN RAW,
mime_type IN VARCHAR2 DEFAULT 'application/octet',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
last IN BOOLEAN DEFAULT FALSE);
-- Send an attachment with no size limit. First, begin the attachment
-- with begin_attachment(). Then, call write_text repeatedly to send
-- the attachment piece-by-piece. If the attachment is text-based but
-- in non-ASCII or multi-byte character set, use write_mb_text() instead.
-- To send binary attachment, the binary content should first be
-- encoded in Base-64 encoding format using the demo package for 8i,
-- or the native one in 9i. End the attachment with end_attachment.
PROCEDURE begin_attachment(conn IN OUT NOCOPY utl_smtp.connection,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
inline IN BOOLEAN DEFAULT TRUE,
filename IN VARCHAR2 DEFAULT NULL,
transfer_enc IN VARCHAR2 DEFAULT NULL);
-- End the attachment.
PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
last IN BOOLEAN DEFAULT FALSE);
-- End the email.
PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);
-- Extended email API to send multiple emails in a session for better
-- performance. First, begin an email session with begin_session.
-- Then, begin each email with a session by calling begin_mail_in_session
-- instead of begin_mail. End the email with end_mail_in_session instead
-- of end_mail. End the email session by end_session.
FUNCTION begin_session RETURN utl_smtp.connection;
-- Begin an email in a session.
PROCEDURE begin_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection,
sender IN VARCHAR2,
recipients IN VARCHAR2,
subject IN VARCHAR2,
mime_type IN VARCHAR2 DEFAULT 'text/plain',
priority IN PLS_INTEGER DEFAULT NULL);
-- End an email in a session.
PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
-- End an email session.
PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);
END;How should I solve the above error? Can anyone help me with my query please?
If I add the code to start TLS it still gives me an error. If I add the code
utl_smtp.command(conn,'STARTTLS');
utl_smtp.helo(conn, smtp_domain);
under email_sender_help package just before under begin_session function, it gives me an error saying:
ORA-29279: SMTP permanent error: 503 5.5.1 EHLO/HELO first. s27sm2097329qbs.12
So then if i enter the same code after:
utl_smtp.command(conn,'STARTTLS');
utl_smtp.helo(conn, smtp_domain);
It gives me an error:
ORA-29278: SMTP transient error: 421 Service not available
Message was edited by:
Monk
Message was edited by:
Monklook like rely turned off on the server..
check this.. or ask your network guys..
Go to Control Panel->Add or Remove Programs->Click on
Add/Remove Wndows Components
Check IIS check box.
Select Internet Information Service (IIS) option and click on Details button
Check whether SMTP Service is checked or not.
If not selected then select SMTP check box.
This process should be done on server.
It will help out from ORA-29278: SMTP transient error: 421 Service not available problem.
thanks -
[Request For Help] How To Send Email Midlet Using Secure Socket ?
Hello, this is the first time i ask for help to forum.sun.com.
i try to make secure connection for send email from MIDlet. Maybe you can check to my code :
EmailMidlet.java
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.;
public class EmailMidlet extends MIDlet implements CommandListener{
Display display = null;
// email form fields
TextField toField = null;
TextField subjectField = null;
TextField msgField = null;
Form form;
static final Command sendCommand = new Command("send", Command.OK, 2);
static final Command clearCommand = new Command("clear", Command.STOP, 3);
String to;
String subject;
String msg;
public EmailMidlet() {
display = Display.getDisplay(this);
form = new Form("Compose Message");
toField = new TextField("To:", "", 50, TextField.EMAILADDR);
subjectField = new TextField("Subject:", "", 15, TextField.ANY);
msgField = new TextField("MsgBody:", "", 90, TextField.ANY);
public void startApp() throws MIDletStateChangeException {
form.append(toField);
form.append(subjectField);
form.append(msgField);
form.addCommand(clearCommand);
form.addCommand(sendCommand);
form.setCommandListener(this);
display.setCurrent(form);
public void pauseApp() {
public void destroyApp(boolean unconditional) {
notifyDestroyed();
public void commandAction(Command c, Displayable d) {
String label = c.getLabel();
if(label.equals("clear")) {
destroyApp(true);
} else if (label.equals("send")) {
to = toField.getString();
subject = subjectField.getString();
msg = msgField.getString();
EmailClient client = new EmailClient(this,"[email protected]", to, subject, msg);
client.start();
}and EmailClient.java
import javax.microedition.io.;
import javax.microedition.lcdui.;
import java.io.;
import java.util.Date;
public class EmailClient implements Runnable {
private EmailMidlet parent;
private Display display;
private Form f;
private StringItem si;
private SecureConnection sc; //SSL
private InputStream is;
private OutputStream os;
private String smtpServerAddress = "smtp.gmail.com"; //SSL
String from;
String to;
String subject;
String msg;
public EmailClient(EmailMidlet m, String from, String to, String subject, String msg) {
parent = m;
this.from = from;
this.to = to;
this.subject = subject;
this.msg = msg;
display = Display.getDisplay(parent);
f = new Form("Email Client");
si = new StringItem("Response:" , " ");
f.append(si);
display.setCurrent(f);
public void start() {
Thread t = new Thread(this);
t.start();
public void run() {
try {
//SSL
sc = (SecureConnection)
Connector.open("ssl://"smtpServerAddress":465"); //smtp with SSL port 465
sc.setSocketOption(SocketConnection.LINGER, 5);
is = sc.openInputStream();
os = sc.openOutputStream();
os.write(("HELO there" "\r\n").getBytes());
os.write(("EHLO" "\r\n").getBytes());
os.write(("auth login" "\r\n").getBytes());
os.write(("dHVnYXNha2hpci50cmlhZGl0eWFAZ21haWwuY29t" "\r\n").getBytes());
os.write(("dGEuZW1haWxjbGllbnQ=" "\r\n").getBytes());
os.write(("MAIL FROM:<">\r\n").getBytes());
os.write(("RCPT TO:<">\r\n").getBytes());
os.write("DATA\r\n".getBytes());
// stamp the msg with date
os.write(("Date: " new Date() "\r\n").getBytes());
os.write(("From: "+from"\r\n").getBytes());
os.write(("To: "to"\r\n").getBytes());
os.write(("Subject: "subject"\r\n").getBytes());
os.write((msg+"\r\n").getBytes()); // message body
os.write(".\r\n".getBytes());
os.write("QUIT\r\n".getBytes());
StringBuffer sb = new StringBuffer();
int ch = 0;
while((ch = is.read()) != -1) {
sb.append((char) ch);
si.setText("SMTP server response - " + sb.toString());
} catch(IOException e) {
e.printStackTrace();
Alert a = new Alert
("TimeClient", "Cannot connect to SMTP server. Ping the server to make sure it is running...", null, AlertType.ERROR);
a.setTimeout(Alert.FOREVER);
display.setCurrent(a);
} finally {
try {
if(is != null) {
is.close();
if(os != null) {
os.close();
if(sc != null) {
sc.close();
} catch(IOException e) {
e.printStackTrace();
public void commandAction(Command c, Displayable s) {
if (c == Alert.DISMISS_COMMAND) {
parent.notifyDestroyed();
parent.destroyApp(true);
} When I try to debug project from netbeans, i found this error :
Starting emulator in debug server mode on port 2668
Connecting to 127.0.0.1 on port 2800
nbdebug:
Waiting for debugger on port 2668
Waiting for KVM...
Running with storage root temp.SonyEricsson_JP8_128x160_Emu10
KdpDebugTask connecting to debugger 1 ..
Running with locale: Indonesian_Indonesia.1252
Connected to KVM
Connection received.
Attached JPDA debugger to localhost:2668
java.io.IOException: error 10054 during TCP read +
at com.sun.midp.io.j2me.socket.Protocol.nonBufferedRead(Protocol.java:299)+
at com.sun.midp.io.BufferedConnectionAdapter.readBytes(BufferedConnectionAdapter.java:99)+
at com.sun.midp.io.BaseInputStream.read(ConnectionBaseAdapter.java:582)+
at com.sun.midp.ssl.Record.rdRec(+41)+
at com.sun.midp.ssl.Record.rdRec(+5)+
at com.sun.midp.ssl.In.refill(+18)+
at com.sun.midp.ssl.In.read(+29)+
at EmailClient.run(EmailClient.java:74)+
Execution completed.
5145824 bytecodes executed
9258 thread switches
1762 classes in the system (including system classes)
0 dynamic objects allocated (0 bytes)
0 garbage collections (0 bytes collected)
debug:
BUILD SUCCESSFUL (total time: 4 minutes 34 seconds)
Regard
LittlebroDon't multipost and don't use the browser's back button to edit your posts as that creates multiple postings. I've removed the other thread you started with the same questio.
Also, don't post to long dead threads. I've blocked your post and locked the thread you resurrected.
db -
Remote users sending email - RBL and SMTP authentication
I've read about the problem of using RBL's with remote Outlook IMAP/SMTP users who may be using dynamically assigned IP addresses. There is a good chance that they will be appear on the RBL and so not be able to send email via the GWIA.
One work around is to have them send their email via their ISP's SMTP server, but this is a pain, because when they are back in the office, then need to switch their SMTP server back to the inhouse one.
So on the GW 7.0.3 server running on SLES 10, I wondered if the one host could handle multiple GWIA's??
1st existing GWIA:
To handle the regular in/out email with RBL's protection on it.
2nd new GWIA on a separate port but same IP address to handle just inbound email. This would be used by remote users and require authentication so no need for an RBL on it.
Is this a sound approach?
Any gotchas for setting up two gwia's on the one server and IP address besides separate ports?
I am aware there is the option of using the Groupiwse client or webmail, but firstly these users don't want to change from 'LookOut" due to their address book synch with their mobile phones and secondly sometimes they like to use their smart phones for remote email synchronisation.Maybe I should simplify this a little...
Can the one host handle multiple GWIA's??
1st existing GWIA:
To handle the regular in/out email with RBL's protection on it.
2nd new GWIA on the same host and IP address, but on a separate port to handle just inbound email. This would be used by remote users and require authentication. -
Sending emails with both body and attachment to multiple recipients
I have a requirement to send email with body and attachment to multiple recipients.
Body of the email is a standard text. It is a proxy-to-mail scenario.
Here is what I've done: (I'm using PI 7.11)
One mapping from Source to Target structure (format of the attachment text file)
Second mapping from Target Structure to Mail Package format.
In the second mapping I'm concatenating the output of first step into "Content" of the Mail Package.
"XIPAYLOAD" is the message protocol used.
The "Keep attachments" option in the Mail adapter allows only to send "Content" as attachment or as body of the email.
How to send an email with both content and text?
The other problem is even with using ASMA, I can't send email to multiple recipients. I can only do CC and TO for 1 person each - a total of 2. Although I can resolve this by creating mailing lists, it is better if this can be addressed in PI.
Thanks for any input you can provide!
Edited by: crazylad on Jan 18, 2012 3:39 PMThank you for your response Mikael.
For the first question, I was able to find the solution in the following blog:
XI Mail Adapter : Dynamically building attachment and message body content using a simple UDF
(I just needed to search with the right set of key words )
The key is to set the "Content Encoding" as "None" in the mail adapter. If this is not done, the mail will be sent with an attachment - untitled.bin containing both the mail body and the attachment text. Also, don't forget to check the "Keep Attachments" checkbox in the mail adapter.
Multiple recipients could be added by separating the email IDs with a Comma. I have used ASMA to set the recipients. -
Sending Email From Mobile Phone
So I have Postfix working great and I've always used webmail if I needed to send email from PC's outside of $mynetworks. So fast forward to today where I got my 1st Android powered mobile phone and I can configure the Android mail client to send/receive IMAP email but my question is do I need to become an open relay to allow my random wireless providers dynamic range of IP's to send mail via Postfix? Seems extremely vulnerable and scary to think I would have to allow my providers IP range to relay mail via my MTA. I started reading a bit and I think I need SASL authentication (correct me please if I'm wrong) and since both Postfix 2.8.1 & Dovecot 2.0.11 are configured / using TLS, is there anything else I would need beyond SASL or that you recommend for sending email from my Android powered mobile?
I'm in the same boat, except that I don't have a smartphone yet - but I'm already outlining the changes to my soho-network.
I guess you have to secure the mailserver (using SSL + TLS looks ok to me) and also secure the server as a whole: configure iptables to lock it down completely, except for as little ports as necessary: IMAPS and SMTPS, maybe even on an other-than-default port...
Maybe you are also interested in syncing your calendar: I will be doing that with davical on my server (running for 2 years now) and acal on my Android smartphone: no syncing, but native caldav between server and smartphone...
The other option would be to install openvpn on your server and always work via your VPN.
Last edited by zenlord (2011-03-24 17:57:54) -
i am having internal table contains values.
i want that output should be send as an email attachment to email id given in selection screen.
but chinese can't diaplay rightly in attachment.eg:'批次; ','日期,and so on,all can't display rightly! .
please help me its urgent.thank you
*& Report YPD00010A
*& DEVELOPER/DATE : SJDU / 12.06.2007
*& REPORT: display barcodes which can't be updated in the sta
*& of x_ray
REPORT YPD00010A no standard page heading
line-count 90
line-size 120 .
selection-screen begin of block sel with frame.
PARAMETERS:
PA_WERKS LIKE YP043D-WERKS OBLIGATORY DEFAULT '8000',
PA_MAIL like ys054-mailaddress MATCHCODE OBJECT ZMAILADDRESS,
PA_MAIL1 like ys054-mailaddress MATCHCODE OBJECT ZMAILADDRESS,
PA_ZBAT like YP043D-ZBAT OBLIGATORY MATCHCODE OBJECT ZZBAT. "File
selection-screen end of block sel.
DATA: BEGIN OF Line1,
ZBARCD LIKE yp043d-zbarcd,
END OF Line1.
DATA: ta_yp043d like Line1 occurs 0 with header line.
data: begin of TAB,
X(1) type x value '09',
end of tab,
C(10) type c.
class cl_abap_char_utilities definition load.
c+5(1) = cl_abap_char_utilities=>horizontal_tab.
DATA:
it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER
LINE,
it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0 WITH HEADER
LINE.
data: p_email TYPE somlreci1-receiver .
data: p_email2 TYPE somlreci1-receiver .
DATA: TP_MAIL(255) TYPE C.
DATA: TP_MAIL_MAIN(255) TYPE C.
DATA: TP_MAIL_TMP(255) TYPE C.
DATA:
t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
w_doc_data LIKE sodocchgi1,
w_cnt TYPE I,
w_sent_all(1) TYPE C,
gd_error TYPE sy-subrc,
gd_reciever TYPE sy-subrc.
DATA:COUNT1 TYPE I VALUE 0,
COUNT2 TYPE I VALUE 0.
INITIALIZATION.
clear: ta_yp043d, it_attach, it_message.
REFRESH: ta_yp043d, it_attach, it_message.
START-OF-SELECTION.
PERFORM GET_DATA.
IF PA_MAIL <> ' ' OR PA_MAIL1 <> ' '.
READ TABLE TA_YP043D INDEX 1.
IF SY-SUBRC = 0 .
pERFORM SEND_EMAIL.
ENDIF.
ENDIF.
END-OF-SELECTION.
PERFORM GET_WRITEDATA.
TOP-OF-PAGE.
PERFORM GET_HEADER.
END-OF-PAGE.
*& Form GET_HEADER *
*& To display the header *
FORM GET_HEADER.
data:
tp_header(120) type c.
TP_HEADER = '山东公司条码表'.
WRITE:4 '程序序号:',10 'YPD00010', 42 tp_header,
92 '日期:',102 SY-DATUM+0(4),
106 '年',
108 SY-DATUM+4(2),110 '月',112 SY-DATUM+6(2),114 '日',
/92 '时间 :',SY-TIMLO,
/3 '上传凭证:',18 PA_ZBAT, 92 '页码 :', SY-PAGNO.
ULINE.
ENDFORM.
*& Form GET_DATA
* text
* --> p1 text
* <-- p2 text
FORM GET_DATA .
DATA:TP_ZBARCD LIKE YP043-ZBARCD,
TP_ZBARCD1 LIKE YP043-ZBARCD,
TP_ZVALS LIKE YP043D-ZVALS.
SELECT ZBARCD INTO CORRESPONDING FIELDS OF TABLE ta_yp043d FROM YP043D
WHERE WERKS = PA_WERKS AND ZBAT = PA_ZBAT
AND ZUPDS = 'N' AND ZVALS = 'B' AND ZLVORM <> 'X'.
ENDFORM. " GET_DATA
*& Form GET_WRITEDATA
* text
* --> p1 text
* <-- p2 text
FORM GET_WRITEDATA .
WRITE: /'硫化未上传的条码有:'.
SKIP.
LOOP AT TA_YP043D.
WRITE:TA_YP043D-ZBARCD,' '.
ENDLOOP.
ENDFORM. " GET_WRITEDATA
*& Form SEND_EMAIL
* text
* --> p1 text
* <-- p2 text
FORM SEND_EMAIL.
READ TABLE TA_YP043D INDEX 1.
IF SY-SUBRC = 0 .
* Retrieve sample data from table ekpo
* PERFORM DATA_RETRIEVAL.
* Populate table with detaisl to be entered into .htm file
PERFORM BUILD_XLS_DATA_TABLE.
* Populate message body text
PERFORM POPULATE_EMAIL_MESSAGE_BODY.
* Send file by email attached as .htm file
PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
TABLES it_message
it_attach
USING p_email
'条码系统出库有问题的条码'
'HTML'
'WC_Document'
CHANGING gd_error
gd_reciever.
* Instructs mail send program for SAPCONNECT to send email(rsconn01)
PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
ENDIF.
ENDFORM. " SEND_EMAIL
*& Form BUILD_XLS_DATA_TABLE
* text
* --> p1 text
* <-- p2 text
FORM BUILD_XLS_DATA_TABLE .
CONCATENATE '<' 'HTML' '>' INTO it_attach .
APPEND it_attach.
CONCATENATE '<' 'HEAD' '>' INTO it_attach .
APPEND it_attach.
CONCATENATE
'<meta http-equiv=Content-Type content=' '"' 'text/html; charset= GB2312
''"' '>' INTO it_attach.
APPEND it_attach.
CONCATENATE '<' '/HEAD' '>' INTO it_attach .
APPEND it_attach.
CONCATENATE '<P style=''font-size:12.0PT''><B> 批次:' pa_zbat
'</B></P>' INTO it_attach SEPARATED BY
CL_ABAP_CHAR_UTILITIES=>horizontal_tab.
APPEND it_attach.
CONCATENATE '<P style=''font-size:12.0pt''><B> 日期:' sy-datum
'</B></P>' INTO it_attach SEPARATED BY
CL_ABAP_CHAR_UTILITIES=>horizontal_tab.
APPEND it_attach.
CONCATENATE '<P style=''font-size:12.0pt''><B>' '硫化未上传的条码有: '
'</B></P>' INTO it_attach SEPARATED BY
CL_ABAP_CHAR_UTILITIES=>horizontal_tab.
APPEND it_attach.
*CONCATENATE '<P style=''font-size:12.0pt''><B>' ' ' ' </B></P>' INTO
*it_attach.
*APPEND it_attach.
LOOP AT TA_YP043D .
*CONCATENATE '< style=''font-size:12.0pt''><B> ' TAB-ZBARCD '</B>'
CONCATENATE '<B> ' TA_YP043D-ZBARCD ' </B>' INTO
it_attach .
APPEND it_attach.
ENDLOOP.
ENDFORM. " BUILD_XLS_DATA_TABLE
*& Form POPULATE_EMAIL_MESSAGE_BODY
* text
* --> p1 text
* <-- p2 text
FORM POPULATE_EMAIL_MESSAGE_BODY .
DATA: TP_TEST0(255) TYPE C,
TP_TEST3(255) TYPE C,
TP_TEST(255) TYPE C.
TP_TEST = '当轮胎进行X光机数据上传时,有些条码在硫化阶段不存在资料'.
TP_TEST0 = '请您查看并尽快解决.'.
CONCATENATE TP_TEST TP_TEST0 INTO TP_TEST3 SEPARATED BY ' , '.
APPEND '尊敬的先生/女士,' TO it_message.
APPEND ' ' TO it_message.
APPEND TP_TEST3 TO it_message.
APPEND '具体问题请查看附件.' TO it_message.
APPEND ' ' TO it_message.
APPEND '谢谢.' TO it_message.
APPEND ' ' TO it_message.
APPEND '来自,' TO it_message.
APPEND SY-UNAME TO it_message.
ENDFORM. " POPULATE_EMAIL_MESSAGE_BODY
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT *
*& Send email *
FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES pit_message
pit_attach
USING p_email
p_mtitle
p_format
p_filename
p_attdescription
p_sender_address
p_sender_addres_type
CHANGING p_error
p_reciever.
DATA:
ld_error TYPE sy-subrc,
ld_reciever TYPE sy-subrc,
ld_mtitle LIKE sodocchgi1-obj_descr,
ld_email LIKE somlreci1-receiver,
ld_email2 LIKE somlreci1-receiver,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des ,
ld_sender_address LIKE soextreci1-receiver value
'[email protected]',
ld_sender_address_type LIKE soextreci1-adr_typ,
ld_receiver LIKE sy-subrc.
data: TMP_MAIL(40) TYPE C.
DATA: MAIN_EMAIL(40) TYPE C.
DATA: TMP_POS TYPE I .
DATA: ADD_EMAIL(40) TYPE C.
DATA: L_POS TYPE I, R_POS TYPE I, MAIL_LEN TYPE I.
ld_email = p_email.
ld_email2 = p_email2.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
ld_sender_address = p_sender_address.
ld_sender_address_type = p_sender_addres_type.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = 'SAPRPT'.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = 'F'.
CLEAR t_attachment.
REFRESH t_attachment.
t_attachment[] = pit_attach[].
* Describe the body of the message
CLEAR t_packing_list.
REFRESH t_packing_list.
t_packing_list-transf_bin = space.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES t_packing_list-body_num.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_type = 'RAW'.
APPEND t_packing_list.
* Create attachment notification
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
t_packing_list-doc_type = ld_format.
t_packing_list-obj_descr = ld_attdescription.
t_packing_list-obj_name = ld_attfilename.
t_packing_list-doc_size = t_packing_list-body_num * 255.
APPEND t_packing_list.
* Add the recipients email address
CLEAR t_receivers.
REFRESH t_receivers.
TP_MAIL_MAIN = PA_MAIL.
TP_MAIL = PA_MAIL1.
if sy-subrc = 0 .
t_receivers-receiver = TP_MAIL_MAIN.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
APPEND t_receivers.
ENDIF.
*READ FROM TP_MAIL LIST
TP_MAIL_TMP = TP_MAIL .
WHILE SY-SUBRC = 0 .
SEARCH TP_MAIL_TMP FOR ', ' .
MAIL_LEN = STRLEN( TP_MAIL_TMP ) .
IF SY-SUBRC = 0 .
TMP_POS = sy-fdpos .
ADD_EMAIL = TP_MAIL_TMP+0(TMP_POS) .
R_POS = TMP_POS + 2 .
L_POS = MAIL_LEN - TMP_POS .
TP_MAIL_TMP = TP_MAIL_TMP+R_POS(L_POS) .
ELSE.
ADD_EMAIL = TP_MAIL_TMP .
ENDIF.
t_receivers-receiver = ADD_EMAIL.
t_receivers-rec_type = 'U'.
t_receivers-com_type = 'INT'.
t_receivers-notif_del = 'X'.
t_receivers-notif_ndel = 'X'.
t_receivers-COPY = 'X' .
APPEND t_receivers.
ENDWHILE.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = 'X'
sender_address = ld_sender_address
sender_address_type = ld_sender_address_type
commit_work = 'X'
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = t_packing_list
contents_bin = t_attachment
contents_txt = it_message
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.
* Populate zerror return code
ld_error = sy-subrc.
* Populate zreceiver return code
LOOP AT t_receivers.
ld_receiver = t_receivers-retrn_code.
ENDLOOP.
ENDFORM. " SEND_FILE_AS_EMAIL_ATTACHMENT
*& Form INITIATE_MAIL_EXECUTE_PROGRAM *
*& Instructs mail send program for SAPCONNECT to send email *
FORM INITIATE_MAIL_EXECUTE_PROGRAM.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDFORM. " INITIATE_MAIL_EXECUTE_PROGRAM
Message was edited by:
shanjing du
Message was edited by:
shanjing duTry the following.
You may need to add language parameter to "CALL METHOD cl_document_bcs=>create_document", or perhaps replace it with a call to the ADD_ATTACHMENT method or some other method of this class - there are public methods for text, MIME, office documents.
==================
*& Report ZLOCAL_EMAIL_TEST
Test of ECC Send email using class CL_BCS
REPORT zlocal_email_test.
DATA:
l_obj TYPE REF TO cl_bcs,
l_recip TYPE REF TO if_recipient_bcs,
l_rec TYPE REF TO cl_cam_address_bcs,
sender TYPE REF TO if_sender_bcs,
note TYPE bcsy_text,
line TYPE soli,
l_address TYPE adr6-smtp_addr,
l_result TYPE os_boolean,
l_sub TYPE string,
text TYPE bcsy_text,
document TYPE REF TO cl_document_bcs.
parameters: p_email like ADR6-SMTP_ADDR visible length 70,
p_uname like sy-uname default sy-uname.
START-OF-SELECTION.
Create email instance
l_obj = cl_bcs=>create_persistent( ).
Build text of message
APPEND 'Hello World' TO text.
APPEND 'Hello World 2' TO text.
APPEND 'Hello World 3' TO text.
APPEND 'Hello World 4' TO text.
Create the email document
CALL METHOD cl_document_bcs=>create_document
EXPORTING
i_type = 'RAW'
i_subject = 'subject line'
I_LENGTH =
I_LANGUAGE = SPACE
I_IMPORTANCE =
I_SENSITIVITY =
i_text = text
I_HEX =
I_HEADER =
I_SENDER =
RECEIVING
result = document.
Add document to email object
CALL METHOD l_obj->set_document
EXPORTING
i_document = document.
Short form version
CALL METHOD l_obj->set_document( document ).
Build long subject line
CONCATENATE 'Long subject' sy-abcde 'with still more'
'Long subject' sy-abcde 'with still more'
'Long subject' sy-abcde 'with still more'
INTO l_sub SEPARATED BY space.
Add long subject to the email
CALL METHOD l_obj->set_message_subject
EXPORTING
ip_subject = l_sub.
Get recipient address in correct format
CALL METHOD cl_cam_address_bcs=>create_internet_address
EXPORTING
i_address_string = p_email
RECEIVING
result = l_rec.
Add recipient address to the email
CALL METHOD l_obj->add_recipient
EXPORTING
i_recipient = l_rec
i_express = 'X'.
Get Sender address in correct format
CALL METHOD cl_sapuser_bcs=>create
EXPORTING
i_user = p_uname
RECEIVING
result = sender.
Short form version of this method call
sender = cl_sapuser_bcs=>create( sy-uname ).
Add sender to the email
CALL METHOD l_obj->set_sender
EXPORTING
i_sender = sender.
Send the email
CALL METHOD l_obj->send
EXPORTING
I_WITH_ERROR_SCREEN = SPACE
RECEIVING
result = l_result.
Required commit work.
COMMIT WORK.
Maybe you are looking for
-
Downgrade weblogic version from 10.3.1.0 to 10.3.0.0
Hi, Is there any way I can downgrade he weblogic version from 10.3.1.0 to 10.3.0.0 without haveing impact on my current existing domain which was created using 10.3.1.0? If so please post me the steps. thanks Pooja
-
Broken iMac G5 refuses to see internal HD
I have an iMac G5 1.8ghz that refuses to see the internal HD, i can boot from CD, like techtool or OS X disk and it works fine - but then when we look for any sort of HD, nothing is listed. I have tried putting my old G4 powermac into target mode and
-
NOKIA N8 ---- GREEN TO SILVER , CHANGE , PLEASE HE...
I have a new nokia n8 green color , my brother bought it for me , and i really hate the green color . I love silver , and i would love to change the color to silver , My mobile is new with no scratches and even the sticker is not removed on the ba
-
Business scenario for mapping XML-EDI
Hi, Can anyone explain me the process of mapping xml-edi to SAP and validations with respect to business. An example could really help. Thanks
-
Throw the MacBook through the closed window- Sharing not possible
--skip intro? --NO: This is again one of the questions that should never be a problem with a machine that has such a good marketing that it is labeled as "easy to use" - NO it is NOT easy to use. And this is not the only issue I have with it AND I th