Regarding Send E-Mail..
Dear Friend,
I don't want to use coding. I want to send through Toolbar E-Mail Icon.
I am not using SDK i want to configure E-Mail in SAP.
I tried but when i wil click that Icon it throws Error,
"Attachement folder not define and attache ment folder has been changed or remove"
After that send message sceen open but when i wil Add receipient it add but when i click on send button it again throws Error,
"E-mail address has not been define for the sender, Cannot send E-Mail,SMS or Fax.."
Thanks,
Hi Harish,
First, if you are send marketing documents as an E-mail, you should define
the correct path for the attachments folder under Administration -> System Initialization -> General settings -> Path
For second error, the user sending e-mail has to be defined e-mail address
under Adminstration -> Setup -> General -> Users
Regards,
Vijay kumar
SAP Business One Forums Team
Similar Messages
-
Hi,
can any one help me out in sending a mail
i have all the data in hand regarding the sales order
i need to format all the data in the body of the mail
how can i format the data on the body of the mail
and wat function module i need to use to send the mail
regards,
siva
Points will be awardedHi,
Try following code:
report ztest_email.
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_receivers like somlreci1 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.
write:/ 'done'.
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.
Populate the subject/generic message attributes
gd_doc_data-obj_descr = psubject.
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-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'
commit_work = 'X'
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 useful. -
Issue regarding sending E-Mail with PDF file(s) as attachment
Hi,
Can anybody provide me with code to send PDF file as E-Mail Attachment!
I know we have to use F.M <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> but how we have to use it to send PDF file as attachment!
I was able to send Text files as Attachments in my previous assignments.
Thanks in advance.
Thanks & Regards,
Kumar.Hi,
Check this threads:
SO_NEW_DOCUMENT_ATT_SEND_API1
unable to e-mail a pdf through FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'
SO_NEW_DOCUMENT_ATT_SEND_API1
Best regards,
Guillaume
Message was edited by: Guillaume Garcia -
Issue regarding sending attachment mail
hi all
i am using function module "SO_NEW_DOCUMENT_ATT_SEND_API1"
i am facing problem in sending attachment .....if width of my text line is more than 255.
pls guide me how to proceed furtherHi,
Check this threads:
SO_NEW_DOCUMENT_ATT_SEND_API1
unable to e-mail a pdf through FM 'SO_NEW_DOCUMENT_ATT_SEND_API1'
SO_NEW_DOCUMENT_ATT_SEND_API1
Best regards,
Guillaume
Message was edited by: Guillaume Garcia -
This question regarding sending mail from sap
hi to all,
this question regarding sending mail from sap
rt now iam able to send mails from 500 clint, what r the setting i need to do send mails from my another client 700,
iam using ecc 6.0 with sql database
regards,
krishna
Moderator message: FAQ, please search for available information before asking.
locked by: Thomas Zloch on Aug 16, 2010 2:11 PMhi to all,
this question regarding sending mail from sap
rt now iam able to send mails from 500 clint, what r the setting i need to do send mails from my another client 700,
iam using ecc 6.0 with sql database
regards,
krishna
Moderator message: FAQ, please search for available information before asking.
locked by: Thomas Zloch on Aug 16, 2010 2:11 PM -
Regarding sending mails from SAP
Hi Frnds,
I have a requirement in which i have to send a mail from SAP to a distribution list of a particular domain, for example [email protected] which contains no. of individual mail ids of the same domain.
And i am using a FM called SO_NEW_DOCUMENT_ATT_SEND_API1.
Here i need to populate the internal table "receivers",
like, receivers-receiver = '[email protected]'
receivers-rec_type = ?
I am not sure as to what value to be filled in the field "receivers-rec_type". I have tried with the values 'P', 'C' and 'U'.
Can anyone please give me some input as to what value needs to be assigned to this field?
Many thanks in advance...
Regards,
Karthick CHi,
use 'U' in the receiver type .....
Here also is a very simple program. You must also have SAPconnect configured correctly. You can force the SEND process using the commented program at the bottom of this example.
report reddy_0003 .
For API
data: maildata type sodocchgi1.
data: mailtxt type table of solisti1 with header line.
data: mailrec type table of somlrec90 with header line.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt, mailrec.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
mailtxt-line = 'This is a test'.
append mailtxt.
mailrec-receiver = '[email protected]'.
mailrec-rec_type = 'U'.
append mailrec.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
tables
object_header = mailtxt
object_content = mailtxt
receivers = mailrec
exceptions
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
others = 8.
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
submit rsconn01 with mode = 'INT' and return.
Regards
Sudheer -
Regarding Sending Mail while an employee is hired.
Hi all,
Currently we have an process of sending a mail to a set of Email Address while an employee is hired using the Transaction PA40.
Now the requirement is to remove some Email Address, so that the concern person would get the mail about hiring.
How can i remove the mail id. Where will be it stored.
Our customer says that they have used some user exit to hard code. But using SMOD, i check it, but there is no user exit is available.
So can you provide me a solution for this
Edited by: Sudeesh Ravindran on Jun 24, 2011 11:33 AMTypically you can use user -exit EXIT_SAPFP50M_002 for this kind of activity. Check if include put in this function module is implemented.
-
Good Afternoon,
I'm using the following code to send e-Mails:
LOOP AT t_z3emailusr INTO w_z3emailusr.
t_receivers-receiver = w_z3emailusr-email.
t_receivers-rec_type = 'U'.
t_receivers-express = 'X'.
APPEND t_receivers.
ENDLOOP.
MOVE text-003 TO t_mailtxt-line.
APPEND t_mailtxt.
CLEAR t_mailtxt-line.
APPEND t_mailtxt.
MOVE text-001 TO t_mailtxt-line.
APPEND t_mailtxt.
CLEAR t_mailtxt-line.
APPEND t_mailtxt.
LOOP AT t_apqi INTO w_apqi.
MOVE w_apqi-groupid TO t_mailtxt-line.
APPEND t_mailtxt.
ENDLOOP.
MOVE text-002 TO t_mailtxt-line.
APPEND t_mailtxt.
CLEAR t_mailtxt-line.
APPEND t_mailtxt.
MOVE text-003 TO t_mailtxt-line.
APPEND t_mailtxt.
MOVE text-004 TO t_mailtxt-line.
APPEND t_mailtxt.
CLEAR t_mailtxt.
DESCRIBE TABLE t_mailtxt LINES mailtxt_size.
MOVE text-000 TO t_doc_att-obj_descr.
MOVE sy-langu TO t_doc_att-obj_langu.
MOVE 'O' TO t_doc_att-sensitivty.
t_doc_att-doc_size = mailtxt_size * 255.
CLEAR t_mailpack-transf_bin.
MOVE 1 TO t_mailpack-head_start.
CLEAR t_mailpack-head_num.
MOVE 1 TO t_mailpack-body_start.
MOVE mailtxt_size TO t_mailpack-body_num.
MOVE 'HTM' TO t_mailpack-doc_type.
MOVE sy-langu TO t_mailpack-obj_langu.
APPEND t_mailpack.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = t_doc_att
put_in_outbox = 'X'
TABLES
packing_list = t_mailpack
contents_txt = t_mailtxt
receivers = t_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Everything is ok except for the text...
Although i'm appending lines in t_mailtxt the text of the e-mail is continuous...
How to display text with "line breaks"? Do i need to change the doc_type of t_mailpack?
Regards,
Pedro GasparYes .. change the doc_type.
-
I want to email a Pages document as a Word doc. I used to be able to do this by clicking on 'share' then 'send via mail' then on 'Word' and an email would appear with my word doc attached. Now the email does not come up. Why?
It's difficult to do more than guess when you don't say what version of OS X or Pages you're running, but if you're on the latest, have you tried the Share menu -> Send via Mail command?
If that doesn't help, you may have better luck if you ask in the Pages forum:
Pages
When you repost, be sure to include full details about your versions so that people know what it is you're working with.
Regards. -
How to send a mail as .txt attachment ,As data is seperated by pipeline
Hi ,
I got a requirement to send a mail in .txt format (Using OOPS) and the data inside the mail is seperated by '|' Pls help me in this regard.
i have written a mail to send the mail in .xls it is working fine for me in .xls but i dont know how to write the same for txt where data should be seperated by '|'.
Regards
sas
Ps: i am attaching my code. and please specify where i need to modify to achieve the same. and any perfromance enhacements are also welcome.
*& Report ZGBTEST02
REPORT YSAS_MAIL2.
*Changes done by sas
*PARAMETERS: P_MAIL TYPE AD_SMTPADR OBLIGATORY, " G C by sas
*P_MAIL1 TYPE AD_SMTPADR OBLIGATORY." G by sas
tables: adr6.
SELECT-OPTIONS:p_eaddr FOR adr6-SMTP_ADDR NO INTERVALS .
*end of changes by sas
DATA: I_GLT0 TYPE STANDARD TABLE OF GLT0.
DATA: I_MARA TYPE STANDARD TABLE OF MARA. " MARA Entries
* I_MARC TYPE STANDARD TABLE OF MARC. " MARC Entries
DATA: L_TEXT TYPE CHAR255. " Text
DATA: L_LINES TYPE I,
L_SIZE TYPE SOOD-OBJLEN.
" Size of Attachment
* Mail related
DATA: I_CONTENT TYPE SOLI_TAB, " Mail content
I_ATTACH TYPE SOLI_TAB, " Attachment
I_ATTACH1 TYPE SOLIX_TAB. " Attachment
DATA: L_SEND_REQUEST TYPE REF TO CL_BCS,
" E-Mail Send Request
L_DOCUMENT TYPE REF TO CL_DOCUMENT_BCS,
" E-Mail Attachment
L_RECIPIENT TYPE REF TO IF_RECIPIENT_BCS,
" Distribution List
L_SENDER TYPE REF TO IF_SENDER_BCS,
" Address of Sender
L_UNAME TYPE SALRTDRCPT,
" Sender Name(SY-UNAME)
L_BCS_EXCEPTION TYPE REF TO CX_DOCUMENT_BCS,
" BCS Exception
L_ADDR_EXCEPTION TYPE REF TO CX_ADDRESS_BCS,
" Address Exception
L_SEND_EXCEPTION TYPE REF TO CX_SEND_REQ_BCS.
" E-Mail sending Exception
*Constants------------------------------------------------------------*
CONSTANTS: C_TAB(1) TYPE C VALUE
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
" Tab Character
C_CR(1) TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF,
" Line Feed for End-Of_line
C_EXT TYPE SOODK-OBJTP VALUE 'XLS'. " XLS Extension
START-OF-SELECTION.
SELECT * FROM MARA INTO TABLE I_MARA UP TO 20 ROWS.
IF SYST-SUBRC EQ 0.
* SELECT * FROM MARC INTO TABLE I_MARC FOR ALL ENTRIES IN I_MARA WHERE MATNR = I_MARA-MATNR.
ENDIF.
*select * from glt0 into table i_glt0.
* Preparing body of the Mail
MOVE 'SAP Material Master Records' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
CLEAR L_TEXT.
APPEND L_TEXT TO I_CONTENT.
MOVE 'Thanks,' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
MOVE 'SAP MM' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
* Creates persistent send request
TRY.
L_SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
* Creating Document
L_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = 'RAW'
I_TEXT = I_CONTENT[]
I_SUBJECT = 'SAS MASTER Records' ).
* Preparing contents of attachment with Change Log
PERFORM PREPARE_ATTACHMENT.
DESCRIBE TABLE I_MARA LINES L_LINES.
* Size to multiplied by 2 for UNICODE enabled systems
L_SIZE = L_LINES * 2 * 255.
* Adding Attachment
CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = C_EXT
I_ATTACHMENT_SIZE = L_SIZE
I_ATTACHMENT_SUBJECT = 'MARA Details'
* i_att_content_hex = i_attach[].
I_ATT_CONTENT_TEXT = I_ATTACH[].
* DESCRIBE TABLE I_MARC LINES L_LINES.
* Size to multiplied by 2 for UNICODE enabled systems
* L_SIZE = L_LINES * 2 * 255.
** Adding Attachment
* CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
* EXPORTING
* I_ATTACHMENT_TYPE = C_EXT
* I_ATTACHMENT_SIZE = L_SIZE
* I_ATTACHMENT_SUBJECT = 'MARC Details'
* I_ATT_CONTENT_HEX = I_ATTACH1[].
** i_att_content_text = i_attach1[].
* Add document to send request
CALL METHOD L_SEND_REQUEST->SET_DOCUMENT( L_DOCUMENT ).
DATA:LR_SENDER TYPE REF TO IF_SENDER_BCS,
LR_SEND TYPE REF TO CL_BCS.
* Preparing the sender object
* LR_SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( sy-uname ).
DATA: L1_UNAME TYPE SY-UNAME.
L1_UNAME = SY-UNAME.
LR_SENDER = CL_SAPUSER_BCS=>CREATE( L1_UNAME ).
* Setting the sender
CALL METHOD L_SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = LR_SENDER.
* E-Mail
LOOP AT P_EADDR.
TRANSLATE P_EADDR-LOW TO LOWER CASE.
L_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( P_EADDR-LOW ).
CALL METHOD L_SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = L_RECIPIENT
I_EXPRESS = 'U'
I_COPY = ' '
I_BLIND_COPY = ' '
I_NO_FORWARD = ' '.
IF SY-subrc EQ 0.
WRITE:/'** SUCCESS: Email Sent to', p_eaddr-LOW COLOR COL_NORMAL.
ELSE.
WRITE:/'** ERROR: Failed to send Email to',p_eaddr-LOW COLOR COL_NEGATIVE .
ENDIF.
ENDLOOP.
*Trigger E-Mail immediately
L_SEND_REQUEST->SET_SEND_IMMEDIATELY( ' ' ).
CALL METHOD L_SEND_REQUEST->SEND( ).
COMMIT WORK.
CATCH CX_DOCUMENT_BCS INTO L_BCS_EXCEPTION.
CATCH CX_SEND_REQ_BCS INTO L_SEND_EXCEPTION.
CATCH CX_ADDRESS_BCS INTO L_ADDR_EXCEPTION.
ENDTRY.
*& Form PREPARE_ATTACHMENT
FORM PREPARE_ATTACHMENT .
FIELD-SYMBOLS: <LFS_TABLE>, " Internal table structure
<LFS_CON>. " Field Content
DATA: L_TEXT TYPE CHAR1024. " Text content for mail attachment
DATA: L_CON TYPE STRING. "(50) TYPE c. " Field Content in character format
DATA: L_STR TYPE STRING,
L_STR1 TYPE STRING.
DATA: LS_SOLIX TYPE SOLIX.
* Columns to be tab delimeted
LOOP AT I_MARA ASSIGNING <LFS_TABLE>.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE <LFS_TABLE>
TO <LFS_CON>.
IF SY-SUBRC NE 0.
CONCATENATE C_CR L_TEXT INTO L_TEXT.
* CONCATENATE l_str c_cr l_text INTO l_str.
* ls_solix-line = l_text.
* APPEND ls_solix TO i_attach.
APPEND L_TEXT TO I_ATTACH.
EXIT.
ELSE.
CLEAR: L_CON.
MOVE <LFS_CON> TO L_CON.
CONDENSE L_CON.
IF SY-INDEX = 1.
CLEAR: L_TEXT.
MOVE L_CON TO L_TEXT.
ELSE.
CONCATENATE L_TEXT L_CON INTO L_TEXT
SEPARATED BY C_TAB.
ENDIF.
ENDIF.
ENDDO.
ENDLOOP.
** Columns to be tab delimeted
* LOOP AT I_MARC ASSIGNING <LFS_TABLE>.
* DO.
* ASSIGN COMPONENT SY-INDEX OF STRUCTURE <LFS_TABLE>
* TO <LFS_CON>.
* IF SY-SUBRC NE 0.
* CONCATENATE C_CR L_TEXT INTO L_TEXT.
** CONCATENATE l_str c_cr l_text INTO l_str1.
* LS_SOLIX-LINE = L_TEXT.
* APPEND LS_SOLIX TO I_ATTACH1.
* EXIT.
* ELSE.
* CLEAR: L_CON.
* MOVE <LFS_CON> TO L_CON.
* CONDENSE L_CON.
* IF SY-INDEX = 1.
* CLEAR: L_TEXT.
* MOVE L_CON TO L_TEXT.
* ELSE.
* CONCATENATE L_TEXT L_CON INTO L_TEXT
* SEPARATED BY C_TAB.
* ENDIF.
* ENDIF.
* ENDDO.
* ENDLOOP.
* i_attach1[] = i_attach[].
ENDFORM. " PREPARE_ATTACHMENTHi Sas,
I have copied the code and executed and it is working fine. I'm getting the text attachement in the email.
* Adding Attachment
CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = 'TXT' " C_EXT My change
I_ATTACHMENT_SIZE = L_SIZE
I_ATTACHMENT_SUBJECT = 'MARA Details'
* i_att_content_hex = i_attach[].
I_ATT_CONTENT_TEXT = I_ATTACH[].
CONCATENATE i_mara-MATNR
i_mara-ERSDA
i_mara-ERNAM
i_mara-LAEDA
INTO L_TEXT
SEPARATED BY '|'. -
How to send a mail as .txt attachment ?
Hi all,
I got a requirement to write code for sending mail in oops.
i have written code for .xls which is working fine. But requirement is to send the mail in the format of txt.
i just only chnge the .xls to .txt where i can see the output properly in sap but problem is that i am unable to get the proper alignment. when i execute the report and see the output in sost i can see the attachment.i am downloading the attachment there only(Our server is not configured to get the mails directly) .So when i open the saved text file on my pc the output is appearing as follows...
pernr nachn vorna
0001 L0001 F0001
0002 L0002 F0002
0003 L0003 F0003
0004 L0004 F0004...
Where it should come in straight line as follows in my o/p code..
pernr nachn vorna
0001 L0001 F0001
0002 L0002 F0002
0003 L0003 F0003
0004 L0004 F0004...
i am puttin g my code ..please correct me where i am wrong .....waiting for your valuabel inputs..
*& Report ZGBTEST02
REPORT YSAS_MAIL2.
*Changes done by sas
*PARAMETERS: P_MAIL TYPE AD_SMTPADR OBLIGATORY, " G C by sas
*P_MAIL1 TYPE AD_SMTPADR OBLIGATORY." G by sas
TABLES: ADR6.
SELECT-OPTIONS:P_EADDR FOR ADR6-SMTP_ADDR NO INTERVALS .
*end of changes by sas
DATA: I_GLT0 TYPE STANDARD TABLE OF GLT0.
*DATA: I_pernr TYPE STANDARD TABLE OF pa0002. " MARA Entries
DATA: BEGIN OF I_PERNR OCCURS 1 ,
PERNR TYPE PA0002-PERNR,
NACHN TYPE PA0002-NACHN,
VORNA TYPE PA0002-VORNA,
END OF I_PERNR..
* I_MARC TYPE STANDARD TABLE OF MARC. " MARC Entries
DATA: L_TEXT TYPE CHAR255. " Text
DATA: L_LINES TYPE I,
L_SIZE TYPE SOOD-OBJLEN.
" Size of Attachment
* Mail related
DATA: I_CONTENT TYPE SOLI_TAB, " Mail content
I_ATTACH TYPE SOLI_TAB, " Attachment
I_ATTACH1 TYPE SOLIX_TAB. " Attachment
DATA: L_SEND_REQUEST TYPE REF TO CL_BCS,
" E-Mail Send Request
L_DOCUMENT TYPE REF TO CL_DOCUMENT_BCS,
" E-Mail Attachment
L_RECIPIENT TYPE REF TO IF_RECIPIENT_BCS,
" Distribution List
L_SENDER TYPE REF TO IF_SENDER_BCS,
" Address of Sender
L_UNAME TYPE SALRTDRCPT,
" Sender Name(SY-UNAME)
L_BCS_EXCEPTION TYPE REF TO CX_DOCUMENT_BCS,
" BCS Exception
L_ADDR_EXCEPTION TYPE REF TO CX_ADDRESS_BCS,
" Address Exception
L_SEND_EXCEPTION TYPE REF TO CX_SEND_REQ_BCS.
" E-Mail sending Exception
*Constants------------------------------------------------------------*
CONSTANTS: C_TAB(1) TYPE C VALUE
CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
" Tab Character
C_CR(1) TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF,
" Line Feed for End-Of_line
C_EXT TYPE SOODK-OBJTP VALUE 'TXT'. " XLS Extension
START-OF-SELECTION.
SELECT PERNR NACHN VORNA FROM PA0002 INTO CORRESPONDING FIELDS OF TABLE I_PERNR UP TO 20 ROWS.
*select * from glt0 into table i_glt0.
* Preparing body of the Mail
* MOVE 'SAP Material Master Records' TO L_TEXT.
* APPEND L_TEXT TO I_CONTENT.
* CLEAR L_TEXT.
* APPEND L_TEXT TO I_CONTENT.
* MOVE 'Thanks,' TO L_TEXT.
* APPEND L_TEXT TO I_CONTENT.
* MOVE 'SAP MM' TO L_TEXT.
* APPEND L_TEXT TO I_CONTENT.
MOVE '<BR>Attached is your HRIS report(s) generated from the Firm''s' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
MOVE ' Human Resources Information System (SAP).' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
MOVE '<BR> ' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
MOVE '<BR>This is an automated report.' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
* MOVE '<BR> ' TO l_text.
* APPEND l_text TO i_content.
MOVE '<BR> ' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
* MOVE '<BR>Please do not reply to this email' TO l_text.
* APPEND l_text TO i_content.
* MOVE '<BR> ' TO l_text.
* APPEND l_text TO i_content.
MOVE '<BR>Thank you.' TO L_TEXT.
APPEND L_TEXT TO I_CONTENT.
* Creates persistent send request
TRY.
L_SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
* Creating Document
L_DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = 'RAW'
I_TEXT = I_CONTENT[]
I_SUBJECT = 'Automated HRIS (SAP) Report' ).
DATA: W_PERNR LIKE I_PERNR.
* Preparing contents of attachment with Change Log
PERFORM PREPARE_ATTACHMENT.
DATA: compressed like solisti1 occurs 10 with header line.
DATA: decompressed like solisti1 occurs 10 with header line.
CALL FUNCTION 'TABLE_COMPRESS'
* IMPORTING
* COMPRESSED_SIZE =
TABLES
* in = eerec
in = i_attach
out = compressed.
CALL FUNCTION 'TABLE_DECOMPRESS'
TABLES
in = compressed
out = decompressed.
DESCRIBE TABLE decompressed LINES L_LINES.
* Size to multiplied by 2 for UNICODE enabled systems
L_SIZE = L_LINES * 2 * 255.
* Adding Attachment
CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = C_EXT
I_ATTACHMENT_SIZE = L_SIZE
I_ATTACHMENT_SUBJECT = 'Hr Details'
* i_att_content_hex = i_attach[].
I_ATT_CONTENT_TEXT = decompressed[].
* DESCRIBE TABLE I_MARC LINES L_LINES.
* Size to multiplied by 2 for UNICODE enabled systems
* L_SIZE = L_LINES * 2 * 255.
** Adding Attachment
* CALL METHOD L_DOCUMENT->ADD_ATTACHMENT
* EXPORTING
* I_ATTACHMENT_TYPE = C_EXT
* I_ATTACHMENT_SIZE = L_SIZE
* I_ATTACHMENT_SUBJECT = 'MARC Details'
* I_ATT_CONTENT_HEX = I_ATTACH1[].
** i_att_content_text = i_attach1[].
* Add document to send request
CALL METHOD L_SEND_REQUEST->SET_DOCUMENT( L_DOCUMENT ).
DATA:LR_SENDER TYPE REF TO IF_SENDER_BCS,
LR_SEND TYPE REF TO CL_BCS.
* Preparing the sender object
* LR_SENDER = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( sy-uname ).
DATA: L1_UNAME TYPE SY-UNAME.
L1_UNAME = SY-UNAME.
LR_SENDER = CL_SAPUSER_BCS=>CREATE( L1_UNAME ).
* Setting the sender
CALL METHOD L_SEND_REQUEST->SET_SENDER
EXPORTING
I_SENDER = LR_SENDER.
* E-Mail
LOOP AT P_EADDR.
TRANSLATE P_EADDR-LOW TO LOWER CASE.
L_RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( P_EADDR-LOW ).
CALL METHOD L_SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = L_RECIPIENT
I_EXPRESS = 'U'
I_COPY = ' '
I_BLIND_COPY = ' '
I_NO_FORWARD = ' '.
IF SY-SUBRC EQ 0.
WRITE:/'** SUCCESS: Email Sent to', P_EADDR-LOW COLOR COL_NORMAL.
ELSE.
WRITE:/'** ERROR: Failed to send Email to',P_EADDR-LOW COLOR COL_NEGATIVE .
ENDIF.
ENDLOOP.
*Trigger E-Mail immediately
L_SEND_REQUEST->SET_SEND_IMMEDIATELY( ' ' ).
CALL METHOD L_SEND_REQUEST->SEND( ).
COMMIT WORK.
CATCH CX_DOCUMENT_BCS INTO L_BCS_EXCEPTION.
CATCH CX_SEND_REQ_BCS INTO L_SEND_EXCEPTION.
CATCH CX_ADDRESS_BCS INTO L_ADDR_EXCEPTION.
ENDTRY.
*& Form PREPARE_ATTACHMENT
FORM PREPARE_ATTACHMENT .
FIELD-SYMBOLS: <LFS_TABLE>, " Internal table structure
<LFS_CON>. " Field Content
DATA: L_TEXT TYPE CHAR1024. " Text content for mail attachment
DATA: L_CON TYPE STRING. "(50) TYPE c. " Field Content in character format
DATA: L_STR TYPE STRING,
L_STR1 TYPE STRING.
*data: w_pernr type TABLE OF I_PERNR.
DATA: LS_SOLIX TYPE SOLIX.
* CONCATENATE 'PERNR' 'FIRST NAME' 'Last Name' C_CR INTO L_TEXT SEPARATED BY '|'.
* append l_text to i_attach.
* clear l_text.
* Columns to be tab delimeted
LOOP AT I_PERNR ASSIGNING <LFS_TABLE>.
DO.
ASSIGN COMPONENT SY-INDEX OF STRUCTURE <LFS_TABLE>
TO <LFS_CON>.
IF SY-SUBRC NE 0.
CONCATENATE C_CR L_TEXT INTO L_TEXT.
* CONCATENATE l_str c_cr l_text INTO l_str.
* ls_solix-line = l_text.
* APPEND ls_solix TO i_attach.
APPEND L_TEXT TO I_ATTACH.
EXIT.
ELSE.
CLEAR: L_CON.
MOVE <LFS_CON> TO L_CON.
CONDENSE L_CON.
IF SY-INDEX = 1.
CLEAR: L_TEXT.
MOVE L_CON TO L_TEXT.
ELSE.
CONCATENATE L_TEXT L_CON INTO L_TEXT
SEPARATED BY C_TAB.
ENDIF.
ENDIF.
ENDDO.
ENDLOOP.
* i_attach1[] = i_attach[].
ENDFORM. " PREPARE_ATTACHMENT
Please if any one having 6.0 version please upload it and see..
Regards
SasHi ,
Did you downloaded from SOST using the display icon and inside that 4th tab for attachment ....
and see?
Regards
sas
pS: THE FIRST page is not allowing the spaces in sdn...
i am getting o/p as
pernr vochn norna
.........0001 f0001 l0001
.................0002 F0002 L0002
.......................0003 F0003 L0003.....
Please remove dots and understand that is the o/p i am getting in my presenation file
i just expecting the o/p as told earlier..
Regards
sas -
Error while sending E-Mail -- 501 Syntax error in parameters or arguments
Dear Friends,
I was trying to send E-Mail using the NTLM Authentication mechanism using the below program:
import java.util.Properties;
import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.mail.PasswordAuthentication;
import java.util.Date;
import com.sun.mail.smtp.*;
public class MailerWithAuthentication
private String smtpServer;
private String fromEmailId;
private String toEmailId;
private String ccEmailId;
private String bccEmailId;
private String subject;
private String message;
private String host;
public MailerWithAuthentication(String toemail, String msg,String sub,String fromId,String host)
this.toEmailId = toemail;;
this.subject = sub;
this.message = msg;
this.fromEmailId=fromId;
this.host=host;
public void sendMail()
String mailContent = "";
try
Authenticator authenticator = new Authenticator();
Properties props = new Properties();
props.put("mail.smtp.host",this.host );
props.put("mail.smtp.port", "25");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.auth.mechanisms", "NTLM");
props.put("mail.smtp.auth.ntlm.flags", "0x00000200");
props.put("mail.smtp.auth.ntlm.domain","sal.ad");
props.put("mail.debug", "true");
Session session = Session.getDefaultInstance(props,authenticator);
Message msg = new MimeMessage(session);
MimeMessage message = new MimeMessage(session);
message.setContent("This is a test", "text/plain");
message.setFrom(new InternetAddress(this.fromEmailId));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(this.toEmailId));
Transport.send(message);
catch (Exception e)
e.printStackTrace();
System.out.println("Exception in MailerThread : run: " + e.getMessage());
private class Authenticator extends javax.mail.Authenticator {
private PasswordAuthentication authentication;
public Authenticator() {
String username= "sal.ad\mailuser";
String password = "mail@123";
authentication = new PasswordAuthentication(username, password);
protected PasswordAuthentication getPasswordAuthentication() {
return authentication;
public static void main(String args[])
try
System.out.println(" Usage : java MailerWithAuthentication <To-Email> <Message> <Subject> <From-Email> <Mail-Server-IP>");
MailerWithAuthentication mailer = new MailerWithAuthentication (args[0],args[1],args[2],args[3],args[4]);
mailer.sendMail();
catch(Exception e)
e.printStackTrace();
Following is the output while running the program:
DEBUG: JavaMail version 1.4ea
DEBUG: java.io.FileNotFoundException: /usr/java/jdk1.5.0_14/jre/lib/javamail.providers (No such file or directory)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
DEBUG: successfully loaded resource: /META-INF/javamail.default.providers
DEBUG: Tables of loaded providers
DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]}
DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: java.io.FileNotFoundException: /usr/java/jdk1.5.0_14/jre/lib/javamail.address.map (No such file or directory)
Mechanishm = NTLM
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "192.168.14.6", port 25, isSSL false
220 ****************************************************************************
DEBUG SMTP: connected to host "192.168.14.6", port: 25
EHLO
501 Syntax error in parameters or arguments -
HELO
501 Syntax error in parameters or arguments -
javax.mail.MessagingException: 501 Syntax error in parameters or arguments -
=================================
The error is :
EHLO
501 Syntax error in parameters or arguments -
HELO
501 Syntax error in parameters or arguments -
=================================
Please tell me what went wrong here. Is it due to any mistake in the program ?
Thanks in advance.hello Anirudh Pucha,
thanks for your message,
i'm downloading all the files you advised and one more doubt regarding SOA installation,
i'm using BPEL Process manager 10.1.3.1.0 installed on my machine and not installed SOA Suite (problem in installing AS Middle tier), i send voice,sms through BPEL PM which works fine, and faced problem in e-mail notification only, according to me with out installing SOA suite we can use BPEL PM or please let me know the procedure to install the downloading files.
if possible please send me a details in word documents to my mail "[email protected]".
Thanks again -
Sending e-mails to multiple users at a time
Hi!
I am using weblogic portal 7.0 for personalization. I am using campaign based e-mails for targetting specific customers. I am able to send e-mail through weblogic portal for users when the user logs in. How can I send group e-mails for a specific campaign. For example, if I have to send "virus alert" campaign mail for all our registered customer. I don't want any batch file to be written for this purpose.
I would really appreciate your help.
Thanks
AnandHi Deepak,
The favorites are placed in the "userhome" repository. Take a look at KM Content -> userhome -> for each username -> Favorites, there you'll find links with the favorites. You can simply copy & paste those to the other users, so you don't have to login with each one.
Regards,
Pascal -
Sending HTML mail using code in workflow
Hi All
I follow somerecomendation to create a program to send the mail out. using a program
My code looks as the following.
DATA: l_docdata TYPE sodocchgi1,
li_content TYPE TABLE OF solisti1,
li_receiver TYPE TABLE OF somlreci1,
l_ename TYPE pa0002-cname,
l_text(255),
lw_receiver TYPE somlreci1.
l_docdata-obj_name = 'Notification'.
l_docdata-sensitivty = 'P'.
l_docdata-proc_syst = sy-sysid.
l_docdata-proc_clint = sy-mandt.
l_docdata-obj_descr = 'TEST'.
l_text = 'Testing Content'.
APPEND l_text TO li_content. CLEAR l_text.
lw_receiver-receiver = 'MyMailtest@GM ail.com'.
lw_receiver-rec_type = 'U'.
APPEND lw_receiver TO li_receiver.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = l_docdata
commit_work = 'X'
DOCUMENT_TYPE = 'HTM'
TABLES
object_content = li_content
receivers = li_receiver
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.
I try to use the code above and i manage to send the mail out. However when i change the l_text = 'Testing Content' to l_text = '<A HREF="http://www.google.com">Click Here</A>' , it does not reach my mailbox even in in transaction SCOT, i can see that it was succesfully transmited.
Anyone have any idea about this?
Thanks.
Regards,
Bryan.Hey PJ,
I manage to send out the email using the htm type. However, instead of having a hyperlink saying click here and it link to another page, i am getting something like this in the email.
Click Here <http://www.google.com>
In my code, i write
<A HREF="http://www.google.com">Click Here</A>
, but the content just turn to above. What i wan is a CLICK HERE link and will link to google.
Thanks.
Regards,
Bryan. -
Sending a mail from oracle database
Hi,
I have a requirement to send a mail from oracle database.I use UTL_TCP package for this.Although my procedure is executed successfully,i dont get the mails in my inbox.Please help me to figure out a solution.
Thanks in advance....Hi, you must use UTL_SMTP package for send emails, it has more performance and features for debug. You must look the next code, this is a example for send emails.
DECLARE
c UTL_SMTP.CONNECTION;
PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS
BEGIN
UTL_SMTP.WRITE_DATA(c, name || ': ' || header || UTL_TCP.CRLF);
END;
BEGIN
c := UTL_SMTP.OPEN_CONNECTION('smtp-server.acme.com');
UTL_SMTP.HELO(c, 'foo.com');
UTL_SMTP.MAIL(c, '[email protected]');
UTL_SMTP.RCPT(c, '[email protected]');
UTL_SMTP.OPEN_DATA(c);
send_header('From', '"Sender" <[email protected]>');
send_header('To', '"Recipient" <[email protected]>');
send_header('Subject', 'Hello');
UTL_SMTP.WRITE_DATA(c, UTL_TCP.CRLF || 'Hello, world!');
UTL_SMTP.CLOSE_DATA(c);
UTL_SMTP.QUIT(c);
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
BEGIN
UTL_SMTP.QUIT(c);
EXCEPTION
WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN
NULL; -- When the SMTP server is down or unavailable, we don't have
-- a connection to the server. The QUIT call will raise an
-- exception that we can ignore.
END;
raise_application_error(-20000,
'Failed to send mail due to the following error: ' || sqlerrm);
END;
Also review the next link for get more information about the UTL_SMTP packege.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_smtp.htm#sthref15587
Regards.
Maybe you are looking for
-
MAM Client - Only User View Manager Link Visible
Hi, I have followed the configuration steps as mentioned in the configuration guide for MAM2.5 SR2. but after deploying the application in mobile device, Only the User View Manager Link is visible to me. Details about client and server version is as
-
JDBC & orcacl performance issue..
I know this is not the right place to post this memo but some of you are very nice and have deep knowledge of what i am going to ask.... I have a java programme which call a stored procedure using oracle callable ( OracleCallableStatement ) slowConn.
-
Migration from Photoshop CC to Photoshop CC 2014 looses all settings?
Hi! I installed Photoshop CC 2014, started it and agreed to migrate the Photoshop CC setting to Photoshop CC 2014. But all my workbench settings are gone. And some of my performance settings also. Please fix that. In my case, it's already too late, b
-
Camera Raw 6.6 missing functions
I use PSE 10 with Camera Raw 6.6. It appears to be missing functions such as the paint brush and the ability to mask. I've tried downloading it again, but the additional functions did not reappear. Any suggestions?
-
I recently purchased a Nokia Lumia 1020 and I am unable to instal the Windows phone App.
I keep getting this error message when I try to install the Windows App: Windows phone can't be installed on Mac HD becasue Mac OS X Version 10.7 or later is required. Under the About this Mac section it says it is: MAC OS X 10.6.8 but there there ar