How to send a ttachment with email.
Dear all ,
i have written the below code to send mails ..it is workiing fine
my problem is data to be shown in the mail is contained in itab
mailtxt77 .... but i want the data contained in this itab
to be sent as attachment ... how to do dat.
*& Report ZTRANSPORTER_EMAIL *
REPORT ZTRANSPORTER_EMAIL .
data: maildata type sodocchgi1.
data: entries like sy-tabix.
data: newid like sofolenti1-object_id.
data: sent like sonv-flag.
data: BEGIN OF mailtxt OCCURS 0,
LINE(300),
END OF MAILTXT.
data: mailrec type table of SOMLRECI1 WITH HEADER LINE .
DATA : MAILREC1 type table of SOMLRECI1.
*data: mailrec type string.
data: lt_transporter like ztransporter occurs 0 with header line.
data: begin of lt_transporter2 occurs 0,
transporter(18),
end of lt_transporter2.
DATA : MAILTXT1(10),
MAILTXT2(30),
MAILTXT3(4),
MAILTXT4(18),
MAILTXT5(10),
MAILTXT6(35),
MAILTXT7(30),
MAILTXT8(40),
MAILTXT9(10),
MAILTXT10(5),
MAILTXT11(8),
MAILTXT12(10),
mail1 type string,
mail2 type string,
mail3 type string,
mail4 type string,
mail5 type string,
mail6 type string,
mail7 type string,
mail8 type string,
mail9 type string,
mail10 type string,
mail11 type string,
mail12 type string.
DATA : MAILTXT77 TYPE TABLE OF SOLISTI1 WITH HEADER LINE.
data: begin of lt_transporter1 occurs 0,
Sr_no(10),
transporter(30),
plant(4),
material(18),
VENDOR(10),
vendor_name(35),
vendor_place(30),
material_desc(40),
sched_agreement(10),
sched_line_item(5),
delivery_date(8),
delivery_qty(10),
end of lt_transporter1.
data: lt_email like ztrans_email occurs 0 with header line.
DATA: BEGIN OF MAILTXT13 OCCURS 0 ,
LINE(300),
END OF MAILTXT13.
data: var1 type i,
var2 type i,
var3 type i,
var4 type i,
var5 type i,
var6 type i,
var7 type i,
var8 type i,
var9 type i,
var10 type i,
var11 type i,
var12 type i.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt. "mailrec.
select * from ztransporter into table lt_transporter.
select distinct transporter from ztransporter into table lt_transporter2
loop at lt_transporter.
move-corresponding lt_transporter to lt_transporter1.
append lt_transporter1.
clear lt_transporter1.
endloop.
if not lt_transporter[] is initial.
select * from ztrans_email into table lt_email
for all entries in lt_transporter
where transporter = lt_transporter-transporter.
endif.
loop at lt_transporter2.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
MAIL1 = 'SR NO-'.
MAIL2 = '---TRANSPORTER--
mail3 = 'plant'.
mail4 = '---material---'.
mail5 = '-vendor'.
mail6 = '--vendor_name--
mail7 = '--vendor_place--
mail8 = '--material_desc--
mail9 = 'sched_agrt'.
mail10 = 'item-'.
mail11 = 'del. date'.
mail12 = '-del. qty-'.
concatenate mail1 ',' mail2 ',' mail3 ',' mail4 ',' mail5 ',' mail6 ','
mail7 ',' mail8 ',' mail9 ',' mail10 ',' mail11 ',' mail12 into
mailtxt77-line
separated by space.
*mailtxt = ' Srno Transporter plant material vendor vendorplace
*materialdesc schedagreement LINEITEM DELIVERYDATE DELIVERYQTY'.
append mailtxt77.
clear mailtxt77.
loop at lt_transporter1 where transporter = lt_transporter2-transporter.
*MOVE LT_TRANSPORTER1+(10) TO MAILTXT(10).
MAILTXT1 = LT_TRANSPORTER1+(10).
*MAILTXT33 = ' '.
var1 = strlen( mailtxt1 ).
var1 = 10 - var1.
shift mailtxt1 right by var1 places.
MAILTXT2 = LT_TRANSPORTER1+10(30).
var2 = strlen( mailtxt2 ).
var2 = 30 - var2.
shift mailtxt2 right by var2 places.
*concatenate mailtxt1 mailtxt2 into mailtxt13-line respecting blanks.
MAILTXT3 = LT_TRANSPORTER1+40(4).
var3 = strlen( mailtxt3 ).
var3 = 4 - var3.
shift mailtxt3 right by var3 places.
MAILTXT4 = LT_TRANSPORTER1+44(18).
var4 = strlen( mailtxt4 ).
var4 = 18 - var4.
shift mailtxt4 right by var4 places.
MAILTXT5 = LT_TRANSPORTER1+62(10).
var5 = strlen( mailtxt5 ).
var5 = 10 - var5.
shift mailtxt5 right by var5 places.
MAILTXT6 = LT_TRANSPORTER1+72(35).
var6 = strlen( mailtxt6 ).
var6 = 35 - var6.
shift mailtxt6 right by var6 places.
MAILTXT7 = LT_TRANSPORTER1+107(30).
var7 = strlen( mailtxt7 ).
var7 = 30 - var7.
shift mailtxt7 right by var7 places.
MAILTXT8 = LT_TRANSPORTER1+137(40).
var8 = strlen( mailtxt8 ).
var8 = 40 - var8.
shift mailtxt8 right by var8 places.
MAILTXT9 = LT_TRANSPORTER1+177(10).
var9 = strlen( mailtxt9 ).
var9 = 10 - var9.
shift mailtxt9 right by var9 places.
MAILTXT10 = LT_TRANSPORTER1+187(5).
var10 = strlen( mailtxt10 ).
var10 = 5 - var10.
shift mailtxt10 right by var10 places.
MAILTXT11 = LT_TRANSPORTER1+192(8).
var11 = strlen( mailtxt11 ).
var11 = 8 - var11.
shift mailtxt11 right by var11 places.
MAILTXT12 = LT_TRANSPORTER1+200(10).
var12 = strlen( mailtxt12 ).
var12 = 10 - var12.
shift mailtxt12 right by var12 places.
*CONCATENATE LT_TRANSPORTER1(10) LT_TRANSPORTER112(30)
*LT_TRANSPORTER142(4) LT_TRANSPORTER148(18)
*LT_TRANSPORTER166(10) LT_TRANSPORTER178(35)
*LT_TRANSPORTER1115(30) LT_TRANSPORTER1147(40)
*LT_TRANSPORTER1189(10) LT_TRANSPORTER1201(5)
*LT_TRANSPORTER1208(10) LT_TRANSPORTER1220(10) INTO MAILTXT-LINE.
CONCATENATE MAILTXT1 ',' MAILTXT2 ',' MAILTXT3 ',' MAILTXT4 ','
MAILTXT5 ','
MAILTXT6 ',' MAILTXT7 ',' MAILTXT8 ',' MAILTXT9 ',' MAILTXT10 ','
MAILTXT11
',' MAILTXT12 INTO MAILTXT77-LINE SEPARATED BY SPACE.
mailtxt = lt_transporter1.
append mailtxt77.
clear mailtxt77.
endloop.
clear lt_email.
read table lt_email with key transporter = lt_transporter2-transporter.
if sy-subrc = 0.
mailrec-receiver = lt_email-main_email.
mailrec = lt_email-main_email.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
append mailrec.
*perform email.
clear mailrec.
if not lt_email-email2 = ''.
mailrec-receiver = lt_email-email2.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
*mailrec = lt_email-email2.
perform email.
append mailrec.
clear mailrec.
endif.
if not lt_email-email3 = ''.
mailrec-receiver = lt_email-email3.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
append mailrec.
*mailrec = lt_email-email3.
perform email.
clear mailrec.
endif.
if not lt_email-email4 = ''.
mailrec-receiver = lt_email-email4.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
append mailrec.
*mailrec = lt_email-email4.
perform email.
clear mailrec.
endif.
if not lt_email-email5 = ''.
mailrec-receiver = lt_email-email5.
mailrec-rec_type = 'U'.
append mailrec.
mailrec = lt_email-email5.
perform email.
clear mailrec.
endif.
endif.
call function 'SO_NEW_DOCUMENT_SEND_API1'
exporting
document_data = maildata
document_type = 'RAW'
put_in_outbox = 'X'
commit_work = 'X'
importing
sent_to_all = sent
new_object_id = newid
tables
object_content = mailtxt77
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.
dear all,
i am now able to get attachments with the mail
but there are 2 attachments
1. . raw
2. .ali - this attachment shows junk characters
i need only one .html file as attachement
if you can kindly find the fault in this code
*& Report ZTRANSPORTER_EMAIL *
REPORT ZTRANSPORTER_EMAIL .
data: maildata type sodocchgi1.
DATA:
l_datum(10),
ls_docdata TYPE sodocchgi1,
lt_objpack TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
lt_objhead TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_objtxt TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_objbin TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_reclist TYPE TABLE OF somlreci1 WITH HEADER LINE,
lt_listobject TYPE TABLE OF abaplist WITH HEADER LINE,
l_tab_lines TYPE i,
l_att_type LIKE soodk-objtp.
data: entries like sy-tabix.
data: newid like sofolenti1-object_id.
data: sent like sonv-flag.
data: BEGIN OF mailtxt OCCURS 0,
LINE(300),
END OF MAILTXT.
data: mailrec type table of SOMLRECI1 WITH HEADER LINE .
DATA : MAILREC1 type table of SOMLRECI1.
*data: mailrec type string.
data: lt_transporter like ztransporter occurs 0 with header line.
data: begin of lt_transporter2 occurs 0,
transporter(18),
end of lt_transporter2.
DATA : MAILTXT1(10),
MAILTXT2(30),
MAILTXT3(4),
MAILTXT4(18),
MAILTXT5(10),
MAILTXT6(35),
MAILTXT7(30),
MAILTXT8(40),
MAILTXT9(10),
MAILTXT10(5),
MAILTXT11(8),
MAILTXT12(10),
mail1 type string,
mail2 type string,
mail3 type string,
mail4 type string,
mail5 type string,
mail6 type string,
mail7 type string,
mail8 type string,
mail9 type string,
mail10 type string,
mail11 type string,
mail12 type string.
DATA : MAILTXT77 TYPE TABLE OF SOLISTI1 WITH HEADER LINE.
data: begin of lt_transporter1 occurs 0,
Sr_no(10),
transporter(30),
plant(4),
material(18),
VENDOR(10),
vendor_name(35),
vendor_place(30),
material_desc(40),
sched_agreement(10),
sched_line_item(5),
delivery_date(8),
delivery_qty(10),
end of lt_transporter1.
data: lt_email like ztrans_email occurs 0 with header line.
DATA: BEGIN OF MAILTXT13 OCCURS 0 ,
LINE(300),
END OF MAILTXT13.
data: var1 type i,
var2 type i,
var3 type i,
var4 type i,
var5 type i,
var6 type i,
var7 type i,
var8 type i,
var9 type i,
var10 type i,
var11 type i,
var12 type i.
start-of-selection.
clear: maildata, mailtxt, mailrec.
refresh: mailtxt. "mailrec.
select * from ztransporter into table lt_transporter.
select distinct transporter from ztransporter into table lt_transporter2
loop at lt_transporter.
move-corresponding lt_transporter to lt_transporter1.
append lt_transporter1.
clear lt_transporter1.
endloop.
if not lt_transporter[] is initial.
select * from ztrans_email into table lt_email
for all entries in lt_transporter
where transporter = lt_transporter-transporter.
endif.
loop at lt_transporter2.
maildata-obj_name = 'TEST'.
maildata-obj_descr = 'Test'.
maildata-obj_langu = sy-langu.
MAIL1 = 'SR NO-'.
MAIL2 = '---TRANSPORTER--
mail3 = 'plant'.
mail4 = '---material---'.
mail5 = '-vendor'.
mail6 = '--vendor_name--
mail7 = '--vendor_place--
mail8 = '--material_desc--
mail9 = 'sched_agrt'.
mail10 = 'item-'.
mail11 = 'del. date'.
mail12 = '-del. qty-'.
concatenate mail1 ',' mail2 ',' mail3 ',' mail4 ',' mail5 ',' mail6 ','
mail7 ',' mail8 ',' mail9 ',' mail10 ',' mail11 ',' mail12 into
mailtxt77-line
separated by space.
*mailtxt = ' Srno Transporter plant material vendor vendorplace
*materialdesc schedagreement LINEITEM DELIVERYDATE DELIVERYQTY'.
append mailtxt77.
clear mailtxt77.
loop at lt_transporter1 where transporter = lt_transporter2-transporter.
*MOVE LT_TRANSPORTER1+(10) TO MAILTXT(10).
MAILTXT1 = LT_TRANSPORTER1+(10).
*MAILTXT33 = ' '.
var1 = strlen( mailtxt1 ).
var1 = 10 - var1.
shift mailtxt1 right by var1 places.
MAILTXT2 = LT_TRANSPORTER1+10(30).
var2 = strlen( mailtxt2 ).
var2 = 30 - var2.
shift mailtxt2 right by var2 places.
*concatenate mailtxt1 mailtxt2 into mailtxt13-line respecting blanks.
MAILTXT3 = LT_TRANSPORTER1+40(4).
var3 = strlen( mailtxt3 ).
var3 = 4 - var3.
shift mailtxt3 right by var3 places.
MAILTXT4 = LT_TRANSPORTER1+44(18).
var4 = strlen( mailtxt4 ).
var4 = 18 - var4.
shift mailtxt4 right by var4 places.
MAILTXT5 = LT_TRANSPORTER1+62(10).
var5 = strlen( mailtxt5 ).
var5 = 10 - var5.
shift mailtxt5 right by var5 places.
MAILTXT6 = LT_TRANSPORTER1+72(35).
var6 = strlen( mailtxt6 ).
var6 = 35 - var6.
shift mailtxt6 right by var6 places.
MAILTXT7 = LT_TRANSPORTER1+107(30).
var7 = strlen( mailtxt7 ).
var7 = 30 - var7.
shift mailtxt7 right by var7 places.
MAILTXT8 = LT_TRANSPORTER1+137(40).
var8 = strlen( mailtxt8 ).
var8 = 40 - var8.
shift mailtxt8 right by var8 places.
MAILTXT9 = LT_TRANSPORTER1+177(10).
var9 = strlen( mailtxt9 ).
var9 = 10 - var9.
shift mailtxt9 right by var9 places.
MAILTXT10 = LT_TRANSPORTER1+187(5).
var10 = strlen( mailtxt10 ).
var10 = 5 - var10.
shift mailtxt10 right by var10 places.
MAILTXT11 = LT_TRANSPORTER1+192(8).
var11 = strlen( mailtxt11 ).
var11 = 8 - var11.
shift mailtxt11 right by var11 places.
MAILTXT12 = LT_TRANSPORTER1+200(10).
var12 = strlen( mailtxt12 ).
var12 = 10 - var12.
shift mailtxt12 right by var12 places.
*CONCATENATE LT_TRANSPORTER1(10) LT_TRANSPORTER112(30)
*LT_TRANSPORTER142(4) LT_TRANSPORTER148(18)
*LT_TRANSPORTER166(10) LT_TRANSPORTER178(35)
*LT_TRANSPORTER1115(30) LT_TRANSPORTER1147(40)
*LT_TRANSPORTER1189(10) LT_TRANSPORTER1201(5)
*LT_TRANSPORTER1208(10) LT_TRANSPORTER1220(10) INTO MAILTXT-LINE.
CONCATENATE MAILTXT1 ',' MAILTXT2 ',' MAILTXT3 ',' MAILTXT4 ','
MAILTXT5 ','
MAILTXT6 ',' MAILTXT7 ',' MAILTXT8 ',' MAILTXT9 ',' MAILTXT10 ','
MAILTXT11
',' MAILTXT12 INTO MAILTXT77-LINE SEPARATED BY SPACE.
mailtxt = lt_transporter1.
append mailtxt77.
clear mailtxt77.
Create receiver list
**LOOP AT s_name.
*lt_reclist-receiver = s_name-low.
**lt_reclist-rec_type = 'B'.
**APPEND lt_reclist.
**ENDLOOP.
Send Message
endloop.
submit zreport with transporter = lt_transporter2-transporter
exporting list to memory and return.
*REFRESH LT_LISTOBJECT.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = lt_listobject
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
Because listobject is of size RAW(1000)
and objbin is of size CHAR(255) we make this table copy
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = lt_listobject
out = lt_objbin
EXCEPTIONS
compress_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
Error in function module &1
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ls_docdata-obj_name = 'USERS_LIST'.
CONCATENATE 'List of Users' sy-sysid '-' l_datum "#EC *
INTO ls_docdata-obj_descr SEPARATED BY space.
Main Text
lt_objtxt = 'List of Users According to Logon Date' &
' and Password Change'. "#EC *
APPEND lt_objtxt.
Write Packing List (Main)
DESCRIBE TABLE lt_objtxt LINES l_tab_lines.
READ TABLE lt_objtxt INDEX l_tab_lines.
ls_docdata-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( lt_objtxt ).
CLEAR lt_objpack-transf_bin.
lt_objpack-head_start = 1.
lt_objpack-head_num = 0.
lt_objpack-body_start = 1.
lt_objpack-body_num = l_tab_lines.
lt_objpack-doc_type = 'RAW'.
APPEND lt_objpack.
Create Message Attachment
Write Packing List (Attachment)
l_att_type = 'ALI'.
DESCRIBE TABLE lt_objbin LINES l_tab_lines.
READ TABLE lt_objbin INDEX l_tab_lines.
lt_objpack-doc_size = ( l_tab_lines - 1 ) * 255 + STRLEN( lt_objbin ).
lt_objpack-transf_bin = 'X'.
lt_objpack-head_start = 1.
lt_objpack-head_num = 0.
lt_objpack-body_start = 1.
lt_objpack-body_num = l_tab_lines.
lt_objpack-doc_type = l_att_type.
lt_objpack-obj_name = 'ATTACHMENT'.
lt_objpack-obj_descr = 'List_of_Users'. "#EC *
APPEND lt_objpack.
clear lt_email.
read table lt_email with key transporter = lt_transporter2-transporter.
if sy-subrc = 0.
mailrec-receiver = lt_email-main_email.
mailrec = lt_email-main_email.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
append mailrec.
*perform email.
clear mailrec.
if not lt_email-email2 = ''.
mailrec-receiver = lt_email-email2.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
*mailrec = lt_email-email2.
perform email.
append mailrec.
clear mailrec.
endif.
if not lt_email-email3 = ''.
mailrec-receiver = lt_email-email3.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
append mailrec.
*mailrec = lt_email-email3.
perform email.
clear mailrec.
endif.
if not lt_email-email4 = ''.
mailrec-receiver = lt_email-email4.
mailrec-rec_type = 'U'.
mailrec-com_type = 'INT'.
mailrec-notif_del = 'X'.
mailrec-notif_ndel = 'X'.
append mailrec.
*mailrec = lt_email-email4.
perform email.
clear mailrec.
endif.
if not lt_email-email5 = ''.
mailrec-receiver = lt_email-email5.
mailrec-rec_type = 'U'.
append mailrec.
mailrec = lt_email-email5.
perform email.
clear mailrec.
endif.
endif.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = ls_docdata
put_in_outbox = ''
commit_work = 'X'
TABLES
packing_list = lt_objpack
object_header = lt_objhead
contents_bin = lt_objbin
contents_txt = lt_objtxt
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.
Document sent
MESSAGE ID 'SO' TYPE 'S' NUMBER '022'.
ELSE.
Document <&> could not be sent
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH ls_docdata-obj_name.
ENDIF.
kindly help..
APT POINTS WILL BE GIVEN..
Similar Messages
-
How to set up SAPconnect with email server
Hi,
Does any one know <b>how to set up SAPconnect with email server</b>
We are using workflow and when it fails it we are sending the notification mail to the user on his company mail id, i.e. [email protected]
This is working in the current production system. We are doing the new development which will replace the current production system. The existing Basis team does not know how it was setup in production system and how to set it up in the new system.
When we send any mail notification from workflow we can see the mail in SCOT transaction but it is not received at the specified mail address.
Can any one provide the configuration steps or any document for this.
Thanks in advance..
PratikHi Pratik,
Check the following link:-
/people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
http://help.sap.com/saphelp_nw04/helpdata/en/2b/d925bf4b8a11d1894c0000e8323c4f/frameset.htm
these link will help u to config SMTP.
And one more thing u have to do..
Go to SE11 n open Table sxnodes in change mode.
And change F_ESMTP field to false i.e. BLANK for the Field NODE = SMTP.
Hope this will work For U.
Regards
Sachin Dhingra -
how to send active links in email from firefox. Works in IE but not Firefox... Is there a setting to change?
== This happened ==
Every time Firefox opened
== AlwaysCheck with your web mail service provider for help with that issue.
-
How to send a mail with HTML body from Oracle
Hi Team,
Can somebody guide me how to send a mail with HTML body from oracle.
Here is the piece of code i am trying to send a mail.
procedure SEND_MAIL is
cursor c_1 is select * from table_name;
l_mail_id varchar2(40);
-- ls_mailhost VARCHAR2(64) := Mailhost;
ls_from VARCHAR2(64) := ‘[email protected]’
ls_subject VARCHAR2(200);
ls_to VARCHAR2(64);
l_mail_conn UTL_SMTP.connection;
ls_left_menu_name VARCHAR2(64);
ll_emp_num number(8);
begin
for i in c_1 loop
begin
l_mail_conn := UTL_SMTP.OPEN_CONNECTION('IP');
UTL_SMTP.HELO(l_mail_conn, 'IP');
UTL_SMTP.MAIL(l_mail_conn, LS_FROM);
UTL_SMTP.RCPT(L_mail_conn, LS_TO);
UTL_SMTP.DATA(l_mail_conn,'From: ' ||ls_from || utl_tcp.crlf ||
'To: ' ||ls_to || utl_tcp.crlf ||
'Subject: ' ||ls_subject|| utl_tcp.crlf);
UTL_SMTP.QUIT(l_mail_conn);
exception
when no_data_found then
null;
when others then
RAISE_APPLICATION_ERROR(-20000, 'Failed to send mail due to the following error: ' || sqlerrm);
end;
end loop;
end;
ThnxHi Nicolas!
Have you tried to set "Output Format" for "RAW Text" to HTM in SCOT.
If HTM is missing in your dropdown-list, you could check out table SXCONVERT2. Copy the line with category T/format TXT, and change the format from TXT to HTM. The existing function
SX_OBJECT_CONVERT__T.TXT does not need to be changed. Now you should be able to choose HTM in SCOT. You will probably need som HTML-tags in your text to make it look good.
Hope this helps!
Regards
Geir -
How to send active links in email from firefox
how to send active links in email from firefox. Works in IE but not Firefox... Is there a setting to change?
== Operating system ==
Windows 7Check with your web mail service provider for help with that issue.
-
How to send HTML mail with images multipart/related message
Hi,
Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
ThanksHi,
Could any body tell me how to send HTML mail with
ith images in "multipart/related" message,if any body
can give the code ,it would be helpful.
ThanksHi!
Refer to
http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
I've found it very helpful.
Look at the last part for a code showing how to send HTML mail!
Regards -
How to send a delayed notification email?
How to send a delayed notification email?
I have a requirement to send an email to the service requestor 2 days after the main fulfillment task is completed. I know I can create a task that auto-completes using the Dummy adapter, but is there a way to make it auto complete after a certain amount of time has elapsed? I was thinking about creating a second fulfillment task that would send this email upon completion, but I can't figure out how to delay its start or its end.Hi Tylor,
James is onto a potential approach here. However, the only way I know of that could work is to use the Scheduled Start feature. This would require that you compute/project the start date of the auto-complete task before the delivery moment begins.
You would need to do a date calculation and then store the projected date in a hidden field. You could then have your auto-complete task fire on that computed date, using the Scheduled Start feature.
The wrinkle here, of course, is t -
How to send puchase report in email ?
how to send puchase report in email ?
Search SCN, you will get lot of post for this.
Here is an example.
http://scn.sap.com/thread/321890 -
I have a Mac OS X 10.6 When I try to send an attachment with email it won't send - keeps saying 'fail'. Please could someone help? Thank you.
Hi lllaass! I replied to your post with the information you required but haven't heard from you since. If you don't, or can't help any further please would you let me know. Thanks.
-
How to Edit Contact List with email
How to Edit Contact List with email ID in the heading
Regards,
Charles.KEeh? Can you please give some detail of what you're attempting to do ?
1. If any post helps you please click the below the post(s) that helped you.
2. Please resolve your thread by marking the post "Solution?" which solved it for you!
3. Install free BlackBerry Protect today for backups of contacts and data.
4. Guide to Unlocking your BlackBerry & Unlock Codes
Join our BBM Channels (Beta)
BlackBerry Support Forums Channel
PIN: C0001B7B4 Display/Scan Bar Code
Knowledge Base Updates
PIN: C0005A9AA Display/Scan Bar Code -
How to send .CSV file via email in Oracle10g/11g PL/SQL
Hi Guys,
Can any one let me know or suggest me how to send .csv file via email attachment using Oracle PL/SQL.
Thanks in advance!
Regards,
LRKA FAQ. Use UTL_MAIL (if attachment is 32KB less). Else use UTL_SMTP. Search this forum. Search using google.
-
How to send multiple attachemnt with a Email
Hello experts,
I have problem with sending multiple attachement with a Email .
I have used program BCS_EXAMPLE_5. it is not for multiple attachment.
Please help me.
Thank you.Hello,
u can make use of these Function Modules.
SO_DOCUMENT_SEND_API1
SO_NEW_DOCUMENT_SEND_API1
'CONVERT_OTFSPOOLJOB_2_PDF'
the program which u gave using the method classes
Thank u,
santhosh
Edited by: santhosh kumar on Dec 2, 2008 2:15 PM -
How to send PDF attachment through Email For Purchase Order
Hi,
Can you please tell me how to send the Purchase Order with PDF attachment. Thank you.
Thanks & Regards,
Rani.Find the below example
*& Report ZSPOOLTOPDF *
*& Converts spool request into PDF document and emails it to *
*& recipicant. *
*& Execution *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on *
*& screen *
REPORT zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_sender LIKE somlreci1-receiver
DEFAULT '[email protected]',
p_delspl AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
wa_tbtcp TYPE t_tbtcp.
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.
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.
CONSTANTS: c_dev LIKE sy-sysid VALUE 'DEV',
c_no(1) TYPE c VALUE ' ',
c_device(4) TYPE c VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
WRITE 'Hello World'.
new-page.
commit work.
new-page print off.
IF sy-batch EQ 'X'.
PERFORM get_job_details.
PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
to sap-spool
spool parameters %_print
archive parameters %_print
without spool dynpro
and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
PERFORM convert_spool_to_pdf.
PERFORM process_email.
if p_delspl EQ 'X'.
PERFORM delete_spool.
endif.
IF sy-sysid = c_dev.
wait up to 5 seconds.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
ENDIF.
ELSE.
SKIP.
WRITE:/ 'Program must be executed in background in-order for spool',
'request to be created.'.
ENDIF.
FORM obtain_spool_id *
FORM obtain_spool_id.
CHECK NOT ( gd_jobname IS INITIAL ).
CHECK NOT ( gd_jobcount IS INITIAL ).
SELECT * FROM tbtcp
INTO TABLE it_tbtcp
WHERE jobname = gd_jobname
AND jobcount = gd_jobcount
AND stepcount = gd_stepcount
AND listident <> '0000000000'
ORDER BY jobname
jobcount
stepcount.
READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
IF sy-subrc = 0.
message s004(zdd) with gd_spool_nr.
gd_spool_nr = wa_tbtcp-listident.
MESSAGE s004(zdd) WITH gd_spool_nr.
ELSE.
MESSAGE s005(zdd).
ENDIF.
ENDFORM.
FORM get_job_details *
FORM get_job_details.
Get current job details
CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
IMPORTING
eventid = gd_eventid
eventparm = gd_eventparm
external_program_active = gd_external_program_active
jobcount = gd_jobcount
jobname = gd_jobname
stepcount = gd_stepcount
EXCEPTIONS
no_runtime_info = 1
OTHERS = 2.
ENDFORM.
FORM convert_spool_to_pdf *
FORM convert_spool_to_pdf.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = gd_spool_nr
no_dialog = c_no
dst_device = c_device
IMPORTING
pdf_bytecount = gd_bytecount
TABLES
pdf = it_pdf_output
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.
CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
LOOP AT it_pdf_output.
TRANSLATE it_pdf_output USING ' ~'.
CONCATENATE gd_buffer it_pdf_output 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.
ENDFORM.
FORM process_email *
FORM process_email.
DESCRIBE TABLE it_mess_att LINES gd_recsize.
CHECK gd_recsize > 0.
PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
FORM send_email *
--> p_email *
FORM send_email USING p_email.
CHECK NOT ( p_email IS INITIAL ).
REFRESH it_mess_bod.
Default subject matter
gd_subject = 'Subject'.
gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
it_mess_bod = 'Message Body text, line 1'.
APPEND it_mess_bod.
it_mess_bod = 'Message Body text, line 2...'.
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
'Example .xls documnet attachment'
'PDF'
gd_attachment_name
gd_attachment_desc
p_sender
gd_sender_type
changing gd_error
gd_reciever.
ENDFORM.
FORM delete_spool *
FORM delete_spool.
DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
ld_spool_nr = gd_spool_nr.
CHECK p_delspl <> c_no.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
spoolid = ld_spool_nr.
ENDFORM.
*& Form SEND_FILE_AS_EMAIL_ATTACHMENT
Send email
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_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[] = 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 = 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.
Reward if helpful.
Thanks,
Kishore S N -
Tutorial Announcement :: how to send a message with file attachments
Hi, everyone
i made a simple tutorial explains how to send email from your site with attachment, using the ADDT`s send email.
also it`s useful when you want to receive let`s say the employee c.v resumes, also it can use for many proposes as explained in the tutorial.
the level for this tutorial is: beginner -- intermediate.
hope it`s useful.
- for more dreamweaver developer toolbox please visit:
www.developer-online.comHi, everyone
i made a simple tutorial explains how to send email from your site with attachment, using the ADDT`s send email.
also it`s useful when you want to receive let`s say the employee c.v resumes, also it can use for many proposes as explained in the tutorial.
the level for this tutorial is: beginner -- intermediate.
hope it`s useful.
- for more dreamweaver developer toolbox please visit:
www.developer-online.com -
how do I send a link via email with my ipa
LIke this:
http://i1224.photobucket.com/albums/ee374/Diavonex/1906911d.jpg
Maybe you are looking for
-
Remote and direct update of master data at the same time
Hello Is it possible to do remote and direct update of master data at the same time? If yes where it could be used? Thanks
-
How to get my photo moments/years to an external hard drive or dropbox
Hello! I'm stuck. I apologize if my technical lingo is wrong. I'm trying to keep my head above water in understanding my predicament. Our home was broken into while away before Christmas, and my 2009 Macbook Pro and new external hard drive were sto
-
Automatically add a current date at the end of the comments
Hi, I have a form on a table with 5 fields... on one the field I am asking my users to enter comments... I am looking for a functionality to automatically add a current date at the end of the comments, only when they are updated or newly filled in...
-
hi i want to unlock my iphone 4s to use it in jordan , i have bought it from cousin and the phone is only work on verizon please help me to unlock it
-
Apex_Util.Prepare_URL Question due to Apex Util Advisor msg
Hi, I have the following code in an SQL statement within an IRR: APEX_UTIL.PREPARE_URL( p_url => 'f?p=' || v('APP_ID') || ':398:'||v('APP_SESSION')||'::NO:398:P398_IDOBJ:||VIMG_SEARCH.IDOBJ:', p_checksum_type => 'SESSION') FullImg, And it works as ex