Website in body of e-mail?
How do you insert a web address into the body of your message so that the reader can click on it and automatically go to that address, as you can in Outlook?
(I'm sure there is a technical term for this.)
If you are referring to a hyperlink such as "click here" instead of http://www.apple.com/ , then you need to ugrade to Tiger Mail since Jaguar or Panther Mail do not support inserting a hyperlink within the body of a message.
When inserting a link within the body of a mesage such as http://www.apple.com/ , you must include the http:// portion and links do not become active in the message body until after sending the message.
After placing a link or email address in the body of a message, check the copy of the sent message in the account's sent mailbox and the link and/or email address will be active.
Similar Messages
-
Cannot Read Body of my Mail on MacBook Pro
I am using Mail with the latest Mavericks on my MacBook Pro....and it is all updated to the latest software updates. For the past 5 or 6 days, I cannot read the body of my mail. The headers etc. are visible but in the preview pane below, nothing shows. I think this started because I had left the computer for a few hours and it went to sleep. When I tried to get back on, nothing happened. I pressed the enter and other keys but it still kept 'sleeping'. I finally resorted to turning the power switch off and was presented with this problem. I have searched these forums and though there are a few instances of this, they either seemed to be with older OS systems or on the initial installation of Mavericks....I have had Mavericks since it first came out with no issues. Also, the majority of these type issues seemed to be with the iPhone or iPad...and I still have not been able to get to the bottom of this.
I have tried to Rebuild the mailbox several times but to no avail. Sometimes the Mail also quits unexpectedly and I am given an error statement. Any help will be greatly appreciated. Thank you.
I have a 2008 MacBook Pro with a 2.53 GHz Intel Core and 8 Gb RAM....and about 40 Gb of free space.Humm,
In the Mail > Preferences I have it set to display in Classic view.
Side bar or Accounts in-boxes and other folders
Then a top window of Messages left or new in the In-boxes and the messages being "read" below that.
There are occasions when deleting a messages in the top window does not automatically select another.
This can mean nothing displays in the bottom box (I just can't re-create it right now ).
If I change to the regular/default view I see the Side Bar still, then the Summary column followed by the Messages column.
The Summary I have chosen has three Messages related to it.
In the Messages column I have scrolled the first to reveal the contents but also show the Header of the next. (I chose to show Full Headers so there is a lot of info here or not only the Sender but the Server(s) it came through to get to me).
I take you do mean the actual Header to the actual message (the lower right item in the pic) rather than calling one of the columns "Headers" ?
7:48 pm Sunday; August 3, 2014
iMac 2.5Ghz i5 2011 (Mavericks 10.9)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad -
Pdf as in the body of e-mail.
Hello experts,
we are sending a pdf as an attachment of an e-mail.what im trying to do is to send pdf in the body of e-mail.
i have search and couldnt find any help in the documents or discussions.
here is my code:
FORM SEND_MAIL
DATA: lv_formname TYPE tdsfname,
lv_fm_name TYPE rs38l_fnam,
ls_control_parameters TYPE ssfctrlop,
ls_output_options TYPE ssfcompop,
lv_user_settings TYPE tdbool VALUE 'X',
ls_job_output_info TYPE ssfcrescl,
ls_job_output_options TYPE ssfcresop.
DATA: lt_otfdata TYPE TABLE OF itcoo,
lt_pdfdata TYPE TABLE OF tline WITH HEADER LINE.
DATA: ls_data TYPE zfi_s_satici_mutabakat.
DATA: ls_document_data LIKE sodocchgi1,
lv_put_in_outbox LIKE sonv-flag,
lv_sender_address LIKE soextreci1-receiver,
lv_sender_address_type LIKE soextreci1-adr_typ,
lv_commit_work LIKE sonv-flag VALUE space,
lt_packing_list TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
lt_object_header TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_contents_bin TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_contents_txt TYPE TABLE OF solisti1 WITH HEADER LINE,
lt_contents_hex TYPE TABLE OF solix WITH HEADER LINE,
lt_object_para TYPE TABLE OF soparai1 WITH HEADER LINE,
lt_object_parb TYPE TABLE OF soparbi1 WITH HEADER LINE,
lt_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE.
DATA: lv_len TYPE i,
lv_pos TYPE i,
lv_tab_lines TYPE i.
DATA: lt_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
CLEAR: lv_formname, lv_fm_name.
lv_formname = 'ZLIMIT_REQUEST_FORM2'.
PERFORM smartform_fm_name USING lv_formname
CHANGING lv_fm_name .
*get PDF Data
ls_control_parameters-getotf = 'X'.
ls_control_parameters-no_dialog = 'X'.
ls_output_options-tdnoprev = 'X'.
LOOP AT itab WHERE sel eq 'X'.
concatenate sy-datum+6(2)'.'sy-datum+4(2)
'.'sy-datum(4) into datum.
CALL FUNCTION lv_fm_name
EXPORTING
control_parameters = ls_control_parameters
output_options = ls_output_options
user_settings = 'X'
datum = datum
EPAYMENT_T1 = EPAYMENT_T1
EPAYMENT_T2 = EPAYMENT_T2
EPAYMENT_D1 = EPAYMENT_D1
EPAYMENT_D2 = EPAYMENT_D2
NAME1 = name1
" itab = itab[]
IMPORTING
job_output_info = ls_job_output_info
TABLES
ITAB = itab
FREE: lt_otfdata, lt_pdfdata.
lt_otfdata[] = ls_job_output_info-otfdata[].
PERFORM convert_otf TABLES lt_otfdata lt_pdfdata.
FREE: lt_receivers, lt_packing_list,
lt_contents_bin, lt_contents_txt.
* Assigning the Description of the object sent in the mail
CLEAR ls_document_data.
ls_document_data-obj_name = 'Limit Talep Formu'.
ls_document_data-obj_descr = 'Limit Talep Formu'.
ls_document_data-expiry_dat = sy-datum + 10.
ls_document_data-sensitivty = 'F'.
LOOP AT gt_mail.
CLEAR : lt_receivers.
lt_receivers-receiver = gt_mail-ZZSAHAMUDUREMAIL. " """reciever list
lt_receivers-rec_type = 'U'.
lt_receivers-com_type = 'INT'.
APPEND lt_receivers.
lt_receivers-COPY = mail_bm.
lt_receivers-rec_type = 'U'.
lt_receivers-com_type = 'INT'.
APPEND lt_receivers.
ENDLOOP.
CLEAR: lt_contents_txt.
lt_contents_txt-line = 'Sayın yetkili,'.
APPEND lt_contents_txt.CLEAR lt_contents_txt.
APPEND lt_contents_txt.
CONCATENATE 'Ekte tarafınıza ait limit formu'
' bulunmaktadır.' INTO lt_contents_txt-line
SEPARATED BY space.
APPEND lt_contents_txt.CLEAR lt_contents_txt.
APPEND lt_contents_txt.
lt_contents_txt-line = 'Saygılarımızla,'.
APPEND lt_contents_txt.CLEAR lt_contents_txt.
CLEAR lt_packing_list.
lt_packing_list-transf_bin = space.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 0.
lt_packing_list-body_start = 1.
lt_packing_list-body_num = LINES( lt_contents_txt ).
lt_packing_list-doc_type = 'RAW'.
APPEND lt_packing_list. CLEAR lt_packing_list.
ls_document_data-doc_size = LINES( lt_contents_txt ) * 255.
CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'
EXPORTING
line_width_src = 134
line_width_dst = 255
TABLES
content_in = lt_pdfdata
content_out = lt_contents_bin
EXCEPTIONS
err_line_width_src_too_long = 1
err_line_width_dst_too_long = 2
err_conv_failed = 3
OTHERS = 4.
*Filling the details in SAPoffice: Description of Imported Object
*Components table
DESCRIBE TABLE lt_contents_bin LINES lv_tab_lines.
CLEAR lt_contents_bin.
READ TABLE lt_contents_bin INDEX lv_tab_lines.
IF sy-subrc = 0.
CLEAR: lt_packing_list.
lt_packing_list-transf_bin = 'X'.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 1.
lt_packing_list-body_start = 1.
lt_packing_list-body_num = lv_tab_lines.
lt_packing_list-obj_langu = sy-langu.
lt_packing_list-doc_type = 'PDF'.
lt_packing_list-obj_name = 'ATTACHMENT'.
lt_packing_list-obj_descr = 'RISK TALEP FORMU.PDF'.
lt_packing_list-doc_size = lv_tab_lines * 255.
APPEND lt_packing_list.CLEAR lt_packing_list.
ENDIF.
lv_put_in_outbox = lv_commit_work = 'X'.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_document_data
put_in_outbox = lv_put_in_outbox
sender_address = lv_sender_address
sender_address_type = lv_sender_address_type
commit_work = lv_commit_work
TABLES
packing_list = lt_packing_list
object_header = lt_object_header
contents_bin = lt_contents_bin
contents_txt = lt_contents_txt
contents_hex = lt_contents_hex
object_para = lt_object_para
object_parb = lt_object_parb
receivers = lt_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 eq 0.
* gt_data-gonderx = 'X'.
* modify gt_data.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDLOOP.
ENDFORM. " SEND_MAILHi Matthew Billingham,
i struggled quite a while if i should write a reply or not.
The fact that one of my posts got rejected by suggesting FM SO_DOCUMENT_SEND_API1 finally made me do so. (maybe the rejection was ok for the context i wrote my post for but reading through the forum i feel like some people going to panic if they read the FM-name).
I totally agree with u using CL_BC-Classes instead of old fashioned-FMs for new development.
But that should not lead us in handling the name SO_DOCUMENT_SEND_API1 like they did with the name Lord Voldemort in Harry Potter.
Wanting to display a PDF in email body instead of adding it as attchment, aint nescessary worth a complete redesign of the existing programm - as Cem Unal already posted his code and told us he just want to change it.
As long as there are programms out that use this FM, there will be questions on how to handle this FM no matter if its obsolete or not. And where should they ask, when they wont be able to ask in the scn-forum?
Reading the FMs documentation, there is nothing mentioning this FM is obsolete.
So the strategie of suggesting to use newer technics because of personal preference should (in my opinion) not lead into deleting posts regarding the old technic on the other hand.
regards
Stefan Seeburger -
Hw to write txt in mail body using UTL mail when sending mail with attachme
hi all
i m using oracle demo mail package to send csv file as attachment to different users its successfull and i can also able to attach text file to it
but i m unable to write any text in mail body .
e.g.
mail body can be--
hi
This is test mail.
Regds
Sender.
can anyone suggest some way?u can try this code
this code takes the file from database and attach with mail and also send the body with it
it works fine.
CREATE OR REPLACE
procedure pdf_mail(
p_sender varchar2, -- sender, example: 'Me '
p_recipients varchar2, -- recipients, example: 'Someone '
p_subject varchar2, -- subject
p_text long, -- text
p_case_id number,
p_email_log_id number
-- p_filename varchar2, -- name of pdf file
p_blob blob pdf file
) is
conn utl_smtp.connection;
i number;
len number;
p_message_part varchar2(32767);
cursor c1 is
select file_name,document_pic
from clm_case_attachments ca,email_log_detail em
where
case_id = p_case_id
and ca.CASE_ATTACHMENT_ID = em.ATTACHMENT_ID
and em.ACTIVE = 'Y'
and em.EMAIL_LOG_ID = p_email_log_id;
BEGIN
conn := demo_mail.begin_mail(
sender => p_sender,
recipients => p_recipients,
subject => p_subject,
mime_type => demo_mail.MULTIPART_MIME_TYPE);
demo_mail.attach_text(
conn => conn,
data => p_text,
mime_type => 'text/html');
for lp in c1 loop
demo_mail.begin_attachment(
conn => conn,
mime_type => 'application/pdf',
inline => TRUE,
filename => lp.file_name,
transfer_enc => 'base64');
-- split the Base64 encoded attachment into multiple lines
i := 1;
len := DBMS_LOB.getLength(lp.document_pic);
WHILE (i < len) LOOP
IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.Substr(lp.document_pic, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
ELSE
UTL_SMTP.Write_Raw_Data (conn
, UTL_ENCODE.Base64_Encode(
DBMS_LOB.Substr(lp.document_pic, (len - i)+1, i)));
END IF;
UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
END LOOP;
demo_mail.end_attachment(conn => conn);
end loop;
demo_mail.end_mail( conn => conn );
END;
/ -
How to read the message body in a mail
how can we read the message body of a mail. i am using pop3 server for reading the mails. my program is
public class GetMessageExample {
public static void main (String args[]) throws Exception {
String host = args[0];
String username = args[1];
String password = args[2];
Properties props = new Properties();
Session session = Session.getInstance(props, null);
Store store = session.getStore("pop3");
store.connect(host, username, password);
Folder folder = store.getFolder("INBOX");
folder.open(Folder.READ_ONLY);
BufferedReader reader = new BufferedReader (
new InputStreamReader(System.in));
Message message[] = folder.getMessages();
for (int i=0, n=message.length; i<n; i++) {
System.out.println(i + ": " + message.getFrom()[0]
+ "\t" + message[i].getSubject());
System.out.println(
"Do you want to read message? [YES to read/QUIT to end]");
String line = reader.readLine();
if ("YES".equals(line)) {
message[i].writeTo(System.out);
} else if ("QUIT".equals(line)) {
break;
folder.close(false);
store.close();
i am getting the following exception
Exception in thread "main" java.lang.NoSuchFieldError: contentStream
at com.sun.mail.pop3.POP3Message.getContentStream(POP3Message.java:115)
at javax.mail.internet.MimePartDataSource.getInputStream(MimePartDataSou
rce.java:61)
at com.sun.mail.handlers.text_plain.getContent(text_plain.java:65)
at javax.activation.DataSourceDataContentHandler.getContent(DataHandler.
java:755)
at javax.activation.DataHandler.getContent(DataHandler.java:511)
at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1072)The Part interface that the Message class implements describes 3 ways for getting the content of a message. To use an Input Stream, you can call the getInputStream() method on the message itself, rather than System.in.
Hope this helps! -
No content in body of Yahoo Mail when using FF 8.0
I have No content in body of Yahoo Mail when using FF 8.0 but is OK when using IE. Have cleared cache, disabled extension and add ons and Java is enabled. Even went to FF 7, but no content in email?
Update your filter subscriptions if you have "Adblock Plus".
# click on ABP toolbar or add-ons button click on "Preferences" then on "Filters, and then on
"Update all subscriptions".
*https://support.mozilla.com/questions/845691 -
How do I send a page via email in the body of the mail and not as an attachment?
I wish to send a page via email in the body of the mail. The only option to send a page appears to be to save it first and then attatch to the mail.
When you are in the Plan View, right click on the icon for the page that you want to omit from the menu. Near the bottom, you'll see Menu Options, click on that and you'll have the choice to Exclude Page from Menus.
-
Is there any way to schedule the webi report as body of the mail
Hi All,
I have a bit different requirement. I need to schedule the webi reports to BlackBerry Mobile .
The report should be displayed not as an attachment or URL but should be the body of the mail.
Is there any Trick or Tip to do that.
Thanks in AdvanceYou could schedule the reports to run as an Excel or PDF document and the destination as a folder on a server. Then after the reports are sent to the destination, you could use the Program Job Server to run a script which parses the files line-by-line and creates an email. It's not the most elegant solution but in theory it should work.
-
Sending Smartform output as a body of the mail not as the attachement
Hi All,
my requirement is like this...
I need to send a smartform output as the body of a mail. and not as the attachment.
Hope you got my question
Regards
RaghuHi,
I hope the following links might help you,
Smartform output as Email.
Smartform to PDF and e_mail? Urgent
Regards,
Hema.
Reward points if it is useful. -
How can I add the Language Toolbar to my English version of Firefox? I want to be able to switch to Japanese language for certain websites and when typing e-mails.
There should be something that allows me to switch back and foth between Japanese and English...or is that in Windows XP and not in the browser?See:
* http://windows.microsoft.com/en-US/windows7/The-Language-bar-overview The Language bar (overview)
* http://support.microsoft.com/kb/258824 - How to change your keyboard layout -
How to get payload as body iin the Mail receiver
Hi,
i am using M2M scenario and getting the output data as am email attahment.
But i need that data as the body of the mail in the receiver.
please help me.
Regards,
Sree.Hi Sreenivas,
Use message protocol as XI payload and make sure that you uncheck the "KeepAttachemts" option. Please refer the below links it may help you.
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
The specified item was not found.
Regards,
Priyanka -
Is there any limit of character that can be sent as body of the mail ?
Hi,
we are in exchange 2010 server environment. Is there any limit of character that can be sent as body of the mail ?
Sankar M http://messagingdevelopment.blogspot.in/Hi Munirathinam,
We can use transport rule and content filtering to implement this function, for example "SubjectOrBodyContains" or "
FromAddressContains". More details about it, please refer to:
Transport Rule Predicates:
http://technet.microsoft.com/en-us/library/dd638183(v=exchg.141).aspx
Understanding Content Filtering:
http://technet.microsoft.com/en-us/library/bb124739(v=exchg.141).aspx
Best Regards,
Allen Wang -
Populate body of the mail when smartform is triggered.
Hi Guru's,
i have configured the smartform, and when i execute the transaction the smartform is being triggered and i am getting the smartform as pdf in a mail.
i want to populate the body of the mail. i am not using the function modules like to convert smartform to pdf then triggering mail. it is triggering from output options.
how to poulate the body of the mail
Best regards,
Chetan.Hello all,
I recently did an object which sends an email with the body.
Step 1.
Do not send the email directly by SAP functionality using smartform function module.
Set the parameter control_parameters-getotf = 'X' of the smartform function module.
step 2.
Use function module CONVERT_OTF
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lf_bin_filesize
BIN_FILE =
TABLES
otf = gs_job_output_info-otfdata
lines = gt_lines
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
err_bad_otf = 4
OTHERS = 5.
Step 3
Use function module QCE1_CONVERT
CALL FUNCTION 'QCE1_CONVERT'
TABLES
t_source_tab = gt_lines
t_target_tab = outbin.
Step 3.
Fill up the details for Email Body + Attachment for the function module SO_NEW_DOCUMENT_ATT_SEND_API1
internal table objtxt will have body of email (txt format)
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'HTM'.
APPEND objpack.
Packing Info Attachment
att_type = 'PDF'
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE outbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = 'description'.
APPEND objpack.
docdata-obj_name = name.
docdata-obj_descr = description.
step 4 :- use function module 'SO_NEW_DOCUMENT_ATT_SEND_API1'
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
Hope this helps. Let me know if you have any questions -
Send an smartform as body of a mail
Hello,
I would like know if there is another way of doing this: "Send an smartform as body of a mail". Now it is sending attached as pdf but the user prefers to view the smartform on the body of the message.
This is a CS formulary and I think that (perhaps) at the options of "output_options TYPE ssfcompop," should be another of this.
ThanksI have included our code to process/send our smartform via email. you should be able to see the solution in there.....
form process_webform
* activate XSF Output Mode
ls_output_options-xsf = c_charx. " XSF Output active
ls_output_options-xsfcmode = c_charx. " Get XSF params from program
ls_output_options-xsfoutmode = c_application. " Application
ls_output_options-xsfformat = c_charx. " Formatting ON
clear ls_output_options-xsfoutdev.
ls_xsfparam_line-name = 'GRAPHICS'.
ls_xsfparam_line-value = 'EXTRACT'.
append ls_xsfparam_line to ls_output_options-xsfpars.
ls_xsfparam_line-name = 'GRAPHICS-DIRECTORY'. "#EC NOTEXT
ls_xsfparam_line-value = c_gr_dir.
append ls_xsfparam_line to ls_output_options-xsfpars.
ls_xsfparam_line-name = 'CONTENT-ID'. "#EC NOTEXT
ls_xsfparam_line-value = 'ENABLE'. "#EC NOTEXT
append ls_xsfparam_line to ls_output_options-xsfpars.
* silent mode ON
ls_output_options-tdimmed = space.
ls_output_options-tdnewid = space.
ls_control_parameters-no_dialog = c_charx.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = pi_form
importing
fm_name = l_fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3.
if sy-subrc <> 0.
* error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
exit.
endif.
call function l_fm_name
exporting
control_parameters = ls_control_parameters
output_options = ls_output_options
user_settings = space
importing
job_output_info = ls_output_data
exceptions
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
others = 5.
if sy-subrc <> 0.
* error handling
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
po_html = ls_output_data-xmloutput-trfresult.
po_t_graphics = ls_output_data-xmloutput-xsfgr.
endform. "process_webform
form send_webform
clear l_html_xstr.
loop at pi_s_html-content into l_html_raw.
concatenate l_html_xstr l_html_raw into l_html_xstr in byte mode.
endloop.
l_html_xstr = l_html_xstr(gs_html_data-length).
call function 'SCP_TRANSLATE_CHARS'
exporting
inbuff = l_html_xstr
incode = '4110' " utf-8
csubst = c_charx
substc_space = c_charx
importing
outbuff = l_html_str
outused = l_html_len
exceptions
others = 1.
if sy-subrc ne 0.
"do nothing
endif.
* change encoding utf-8 to latin1
replace all occurrences of 'utf-8' in l_html_str with 'latin1' ignoring case.
replace all occurrences of 'absolute' in l_html_str with 'relative' ignoring case.
replace all occurrences of 'overflow : auto'
in l_html_str with 'overflow : hidden' ignoring case.
* The following code will replace the standard text shown in an html link
* such as (www.sap.com) with the text passed along with the link (contained in
* brackets [ ] ). An example would be: "www.sap.com[Click me]" will then be
* displayed as a link on the email with "... Click me ..." as the text. HTML links
* without brackets will be displayed normally (ie. www.sap.com)+
do.
* Get the length for the entire HTML code for the URL and Name
find '<a href="' in section offset l_aref_end of l_html_str match offset l_aref_start.
if sy-subrc ne 0.
exit.
endif.
find '</a>' in section offset l_aref_start of l_html_str match offset l_aref_end.
l_aref_length = ( l_aref_end + 4 ) - l_aref_start.
* Find the URL/name
l_lnk_start = l_aref_start + 9.
find '">' in section offset l_aref_start of l_html_str match offset l_lnk_end.
l_lnk_length = l_lnk_end - l_lnk_start.
* Save the URL/name
l_link_all = l_html_str+l_lnk_start(l_lnk_length).
* Find where the name starts and ends
find '[' in l_link_all match offset l_name_start.
if sy-subrc ne 0.
continue.
endif.
find ']' in l_link_all match offset l_name_end.
if sy-subrc ne 0.
continue.
endif.
* Seperate out the URL
l_link_url = l_link_all+0(l_name_start).
* Seperate out the name
l_name_start = l_name_start + 1.
l_name_length = l_name_end - l_name_start.
l_link_name = l_link_all+l_name_start(l_name_length).
* Replace the first URL/Name occurence with just the URL
replace first occurrence of l_link_all
in section offset l_aref_start length l_aref_length
of l_html_str with l_link_url.
* Replace the second URL/Name occurence with just the Name - first
* substitute special characters.
replace all occurrences of '&' in l_link_all with '&'.
replace all occurrences of '>' in l_link_all with '>'.
replace all occurrences of '<' in l_link_all with '<'.
replace first occurrence of l_link_all
in section offset l_aref_start length l_aref_length
of l_html_str with l_link_name.
* Reset ending point
l_aref_end = l_aref_end - ( l_lnk_length + 2 ).
enddo.
l_html_len = strlen( l_html_str ).
l_offset = 0.
l_length = 255.
while l_offset < l_html_len.
l_diff = l_html_len - l_offset.
if l_diff > l_length.
ls_soli-line = l_html_str+l_offset(l_length).
else.
ls_soli-line = l_html_str+l_offset(l_diff).
endif.
append ls_soli to lt_soli.
add l_length to l_offset.
endwhile.
create object lo_mime_helper.
call method lo_mime_helper->set_main_html
exporting
content = lt_soli.
loop at pi_t_graphics into gs_graphic.
clear l_gr_xstr.
loop at gs_graphic-content into l_gr_raw.
concatenate l_gr_xstr l_gr_raw-line into l_gr_xstr in byte mode.
endloop.
l_gr_xstr = l_gr_xstr(gs_graphic-length).
l_offset = 0.
l_length = 255.
clear lt_solix[].
while l_offset < gs_graphic-length.
l_diff = gs_graphic-length - l_offset.
if l_diff > l_length.
ls_solix-line = l_gr_xstr+l_offset(l_length).
else.
ls_solix-line = l_gr_xstr+l_offset(l_diff).
endif.
append ls_solix to lt_solix.
add l_length to l_offset.
endwhile.
concatenate c_gr_dir gs_graphic-graphics '.bmp' into l_filename.
concatenate c_gr_dir gs_graphic-graphics '.bmp' into l_content_id.
l_content_type = gs_graphic-httptype.
l_obj_len = gs_graphic-length.
call method lo_mime_helper->add_binary_part
exporting
content = lt_solix
filename = l_filename
extension = 'BMP'
content_type = l_content_type
length = l_obj_len
content_id = l_content_id.
endloop.
try.
l_standard_txt = pi_smartform.
call function 'READ_TEXT'
exporting
id = 'ST'
language = sy-langu
name = l_standard_txt
object = 'TEXT'
tables
lines = lt_lines.
read table lt_lines into ls_lines index 1.
replace '&1' in ls_lines-tdline with pi_belnr.
replace '&2' in ls_lines-tdline with pi_bukrs.
move ls_lines-tdline to l_subject.
lo_doc_bcs = cl_document_bcs=>create_from_multirelated(
i_subject = l_subject
i_multirel_service = lo_mime_helper ).
* Add Attachment
* types: begin of email_docs,
* type type so_obj_tp,
* subject type so_obj_des,
* content_text type soli_tab,
* content_hex type solix_tab,
* end of email_docs.
* types: email_docs_t type standard table of email_docs.
* data: documents type email_docs_t,
* documents_line like line of documents.
* data: soli_tab type soli_tab,
* soli type soli.
* soli = 'This is line one'.
* append soli to soli_tab.
* soli = 'And this is line two'.
* append soli to soli_tab.
* documents_line-type = 'RAW'.
* documents_line-subject = 'Subject'.
* documents_line-content_text = soli_tab.
* append documents_line to documents.
* call method lo_doc_bcs->add_attachment
* EXPORTING
* i_attachment_type = documents_line-type
* i_attachment_subject = documents_line-subject
* i_att_content_text = documents_line-content_text.
catch cx_document_bcs.
* error handling
exit.
catch cx_bcom_mime.
* error handling
exit.
catch cx_gbt_mime.
* error handling
exit.
endtry.
* create send_request
try.
lo_bcs = cl_bcs=>create_persistent( ).
catch cx_send_req_bcs.
* error handling
exit.
endtry.
try.
lo_bcs->set_document( i_document = lo_doc_bcs ).
catch cx_send_req_bcs.
* error handling
exit.
endtry.
* create recipient
if pi_recipient ns '@'.
l_username = pi_recipient.
translate l_username to upper case. "#EC *
try.
lo_recipient = cl_sapuser_bcs=>create( l_username ).
catch cx_address_bcs.
* error handling
exit.
endtry.
else.
l_mail_address = pi_recipient.
try.
lo_recipient = cl_cam_address_bcs=>create_internet_address( i_address_string = l_mail_address ).
catch cx_address_bcs.
* error handling
exit.
endtry.
endif.
try.
lo_bcs->add_recipient( i_recipient = lo_recipient ).
catch cx_send_req_bcs.
* error handling
exit.
endtry.
* send
try.
* RECEIPTS ONLY FOR ERRORS
call method lo_bcs->send_request->set_requested_status
exporting
i_requested_status = 'N'. "#EC NOTEXT
lo_bcs->send( ).
commit work.
catch cx_send_req_bcs.
* error handling
exit.
endtry.
endform. "send_webform -
Class CL_BCS Query for body part of mail
HI,
I want to send the mail with out attachement using Class CL_BCS. Can any body help me on how to send the message body in the mail using CL_BCS class....
Thanx & Regards,
SameerHi Sameer
I've been struggling with this class CL_BCS too for a while and I want to give my experience with that class. Following a code example which will submit a report to memory and send the report as an attachment by mail thru the SMTP interface.
*& Report ZOBR_SEND_TRIP_SIM_BY_MAIL *
*& This program does following:
*& 1. Submit a travel expense report to memory
*& 2. Read the travel expense report from memory
*& 3. Convert the travel expense report to HTML format
*& 4. Copy the travel expense report from format RAW(1000) to RAW(255)
*& 5. Send an email with body text and attachtments
REPORT zobr_send_trip_sim_by_mail .
DATA:
gi_abaplist TYPE TABLE OF abaplist,
gi_html TYPE w3htmltab,
gs_html LIKE LINE OF gi_html,
gw_string TYPE string,
gw_length TYPE i,
gw_length_c TYPE so_obj_len,
gi_solix TYPE solix_tab,
gs_solix LIKE LINE OF gi_solix,
gi_soli TYPE soli_tab,
gs_soli LIKE LINE OF gi_soli,
go_send_request TYPE REF TO cl_bcs,
go_document TYPE REF TO cl_document_bcs,
go_sender TYPE REF TO cl_sapuser_bcs,
go_recipient TYPE REF TO if_recipient_bcs,
go_exception TYPE REF TO cx_bcs.
* Submit report to memory
SUBMIT rprtef00 "USER sy-uname
EXPORTING LIST TO MEMORY AND RETURN
WITH pnppernr EQ '00001000'
WITH pnptimra EQ 'X'
WITH pnpxabkr EQ 'D2'
WITH pnppabrp EQ '11'
WITH pnppabrj EQ '2006'
WITH s_reisen EQ '0002600221'
WITH hinz_dru EQ space
WITH hinz_weg EQ space
WITH hinz_dyn EQ 'X'
WITH allesdru EQ 'X'
WITH reisepro EQ 'X'
WITH reisetxt EQ 'X'
WITH sw_antrg INCL 'X'
WITH addinfo EQ 'X'
WITH extperio EQ '000'
WITH simulate EQ space
WITH einkopf EQ space.
* Read report from memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = gi_abaplist
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Convert report to HTML format
CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
* EXPORTING
* REPORT_NAME =
* TEMPLATE_NAME = 'WEBREPORTING_REPORT'
TABLES
html = gi_html
listobject = gi_abaplist.
LOOP AT gi_html INTO gs_html.
CONCATENATE gw_string
gs_html
INTO gw_string.
ENDLOOP.
gw_length = STRLEN( gw_string ).
gw_length_c = gw_length.
* copy table from format raw(1000) to raw(255)
CALL FUNCTION 'TABLE_COMPRESS'
TABLES
in = gi_abaplist
out = gi_solix.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
TRY.
* Create persistent send request
go_send_request = cl_bcs=>create_persistent( ).
* Create document (body text in text format)
gs_soli = 'Trip is now settled, see attachment.'.
APPEND gs_soli TO gi_soli.
gs_soli = 'Reimbursement is paid out by your next salary.'.
APPEND gs_soli TO gi_soli.
go_document = cl_document_bcs=>create_document( i_type = 'RAW'
i_text = gi_soli
i_subject = 'Trip reimbursement' ).
* Add attachment (ABAP list format)
CALL METHOD go_document->add_attachment
EXPORTING
i_attachment_type = 'ALI'
i_attachment_subject = 'Expense report(ALI)'
i_att_content_hex = gi_solix.
* Add attachment (HTML format)
CALL METHOD go_document->add_attachment
EXPORTING
i_attachment_type = 'HTM'
i_attachment_subject = 'Expense report(HTM)'
i_att_content_text = gi_html.
* Add note (Text format)
CALL METHOD go_send_request->set_note( gi_soli ).
* Add document to send request
CALL METHOD go_send_request->set_document( go_document ).
* Get sender object
go_sender = cl_sapuser_bcs=>create( sy-uname ).
* Add sender
CALL METHOD go_send_request->set_sender
EXPORTING
i_sender = go_sender.
go_recipient = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
* Add recipient with its respective attributes to send request
CALL METHOD go_send_request->add_recipient
EXPORTING
i_recipient = go_recipient
i_express = ' '
i_copy = ' '
i_blind_copy = ' '
i_no_forward = ' '.
* set send immediately flag
go_send_request->set_send_immediately( 'X' ).
* Send document
CALL METHOD go_send_request->send( ).
COMMIT WORK.
* Exception handling
CATCH cx_bcs INTO go_exception.
EXIT.
ENDTRY.
Notice that the only way to put a body text in the email is to call the method cl_document_bcs=>create_document with input of a type 'RAW'.
Be aware of the settings of the SMTP node in SAPConnect (transaction SCOT) because the seetings could cource an unwanted conversion of the email.
1. Doubbelclick on the TMTP node and a popup screen will show.
2. Click on the 'Set' button next to 'Internet' under 'Supported address type' and a popup screen will show.
3. Set output format for SAP documents as 'SAPscript/Smart forms' = 'PDF', 'ABAP list' = 'PDF', 'RAW text' = 'TXT'.
This setting will convert 'SAPscript/Smartforms', 'ABAP list' to PDF format. If 'RAW text' = 'PDF' the body text wil be converted to 'PDF' format and change to an attachment and the body text will disappear.
Hope this is usefull for you and others.
Best regards
Ove Bryntesson
Applicon A/S
Maybe you are looking for
-
I am testing out Dreamweaver 8 and would like to use the image viewer to display several images that are looped. However, I cannot get GIF files to be displayed with the image viewer; JPG files are no problem. Any suggestions? Thanks
-
Does photosmart d110a have 802.11a? If not, does it have 802.11n?
Had it connected via b/g WiFi but it doesnt seem to connect with my new router even though ive checked all settings. The manual and cd are useless, and hp site's specs for this photosmart are useless. Appreciate your help if you can find out if it's
-
Hi all, Suppose we have 100 items associated with pricelist1. in which price of each item is defined. For e.g.: PriceList 1 ItemName ItemPrice Item1 100 Item2 102 Item3 101 Item4
-
Mail for Exchange and the dreaded 500 error!
Hi I've recently got myself a Nokia 5800 and have been trying to get Mail for Exchange working for the past week and a half. I've read and actioned almost every suggestion that I can find on the web but still no joy! The jist of the problem is as fol
-
Changing the Subject and Text of received mails?
Before filing received important messages into folders, I would like to add the Sender's name into the Subject. Or I may want to add a comment to the received Text. Is it possible in Mail? (like in Entourage?) iMac G% Mac OS X (10.4.3)