Receiving PDF attachment as inline text
Hi -
I recently set up Mail on my iMac with an IMAP account. It looks like the emails I receive with PDF attachments appear as inline text within the body of the email when I download them from the IMAP server. I am able to log onto the IMAP server via its webmail interface, and download the PDF as a separate attachment that way.
I am able to receive .zip files as attachments just fine.
Any advice would be appreciated.
Thanks,
Tom
I don't think that's exactly what is happening with me. It doesn't appear as an inline image, but rather as an inline "octet stream" which looks like it is the computer code that underlies the image. E.g.:
------=_NextPart_00101C8173E.31943807
Content-Type: application/octet-stream;
name="Payne OGL.pdf"
Content-Transfer-Encoding: base64
Content-Description: Payne OGL.pdf
Content-Disposition: attachment;
filename="Payne OGL.pdf"
JVBERi0xLjIKJcjH0MRGCjQgMCBvYmoKPDwKL1R5cGUgL091dGxpbmVzCi9Db3VudCAwCj4+CmVu
ZG9iago1IDAgb2JqCjw8Ci9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovTmFtZSAvRjAKL0Jh
c2VGb250IC9IZWx2ZXRpY2EKL0VuY29kaW5nIC9NYWNSb21hbkVuY29kaW5nCj4+CmVuZG9iago2
IDAgb2JqCjw8Ci9UeXBlIC9QYWdlCi9QYXJlbnQgMyAwIFIKL1Jlc291cmNlcyA4IDAgUgovTWVk
aWFCb3ggWyAwIDAgOTkwLjcyIDU5OS4wNCBdCi9Db250ZW50cyA3IDAgUgo+PgplbmRvYmoKOSAw
IG9iago8PAovVHlwZSAvWE9iamVjdAovU3VidHlwZSAvSW1hZ2UKL05hbWUgL0ltMAovV2lkdGgg
Mjc1MgovSGVpZ2h0IDE2NjQKL0JpdHNQZXJDb21wb25lbnQgMQovQ29sb3JTcGFjZSAvRGV2aWNl
R3JheQovRmlsdGVyIC9DQ0lUVEZheERlY29kZQovRGVjb2RlUGFybXMgPDwgL0sgLTEgL0NvbHVt
bnMgMjc1MiAPgovTGVuZ3RoIDEwIDAgUgoPgpzdHJlYW0K///////////JH/v3k1X77kBQ1t4/
/t736t5Af2DRouJAcTol865EaF8gKDbKQjWjsaRD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IKPj4Kc3RhcnR4cmVmCjIyNzQyNAolJUVPRgo=
------=_NextPart_00101C8173E.31943807--
Similar Messages
-
I've been struggling with this for two days now. So, I need some input. I have followed the JavaMail example for attaching a file, but it appears inline instead, looking like the pasted content below.
I'm doing the typical:
MimeBodyPart mbp2 = new MimeBodyPart();
// attach the file to the message
FileDataSource fds = new FileDataSource(filename);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
// create the Multipart and add its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);Thanks for any help,
Ron
------=_Part_4_11866827.1252079069030
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Please see attached report. If you experience difficulty in opening the report directly from this e-mail, first save the attachment to your local computer, and then open it from the saved location.
------=_Part_4_11866827.1252079069030
Content-Type: text/plain; name="C:/tmp/pcards/RG1252079068343_approval.pdf"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="C:/tmp/pcards/RG1252079068343_approval.pdf"
JVBERi0xLjQKJeLjz9MKMiAwIG9iaiA8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvVHlwZS9YT2JqZWN0
L0xlbmd0aCAxNTM3L0JpdHNQZXJDb21wb25lbnQgOC9IZWlnaHQgNDIvQ29sb3JTcGFjZVsvSW5k
ZXhlZC9EZXZpY2VSR0IgMjU1KP////f39//39/fn5//v7//n5/fe3vfW1u/OzvfOzu/GxvfGxu+9
ve+1te+tre+lpeeUlOeMjN5zc95ra95aWt5SUs5cKVwpzlxiXGLGAADOAADn7+fv9+/3//fW
ve+1te+tre+lpeeUlOeMjN5zc95ra95aWt5SUs5cKVwpzlxiXGLGAADOAADn7+fv9+59YA
WhjO59bG3s6UxqWMvZyEtZRCjFoxe0pjpXtcKYRKGHM5pc61jLWca62EWpxzUpRrAGtcKZzGrTmM
WjGEUlwpe0oAUiGUvaWc1rWUzq2MxqWEvZx7tZRzrYxrpYRjnHtCpWs5nGMhlFIYe0I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L0NvbHVtbnMgNjIvUHJlZGlj
dG9yIDE1L0NvbG9ycyAxL0JpdHNQZXJDb21wb25lbnQgOD4+L1N1YnR5cGUvSW1hZ2UvV2lk
dG9yIDE1L0NvbG9ycyAxL0JpdHNQZXJDb21wb25lbnQgOD4+dGgg
NjI+PnN0cmVhbQp4nJVW/U8TZxw/dAMlaOZ+WB7AZU6XbGTQ2unmKGZvHqPtULraPmwhe5HB
NjI+1S3e
[clipped]
------=_Part_4_11866827.1252079069030--Thanks, DrClap. I appreciate the input. I probably just included a bad example of the many variations of the code that I've tried. So, let me paste here the fuller version of the code and the javamail debug output. I've played with those headers in every way I can think of. It still goes inline. Argggh!
public class SendMailWithAttachment
private String from;
private String to;
private String subject;
private String text;
private String fileName;
public SendMailWithAttachment(String from, String to, String subject, String text, String fileName)
this.from = from;
this.to = to;
this.subject = subject;
this.text = text;
this.fileName = fileName;
public void send()
boolean debug = true;
// create some properties and get the default Session
Properties props = System.getProperties();
props.put("mail.smtp.host", "smtp.xxx.com");
Session session = Session.getInstance(props, null);
session.setDebug(debug);
try
// create a message
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(from));
msg.addRecipient(RecipientType.TO, new InternetAddress("[email protected]"));
msg.setSubject(subject);
// create the text message part
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText(text);
mbp1.setHeader("MIME-Version", "1.0");
mbp1.setHeader("Content-Type", "text/plain; charset='iso-8859-1'");
// create the pdf attachment part
MimeBodyPart mbp2 = new MimeBodyPart();
FileDataSource fds = new FileDataSource(fileName);
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
mbp2.setHeader("MIME-Version", "1.0");
mbp2.setHeader("Content-Type", "application/pdf");
mbp2.setHeader("Content-Disposition", "attachment");
mbp2.setHeader("Content-Transfer-Encoding", "base64");
// create the Multipart and add its parts to it
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
// add the Multipart to the message
msg.setContent(mp);
// add headers for message
msg.setHeader("MIME-Version", "1.0");
msg.setHeader("Content-Type", "multipart/mixed");
msg.setHeader("X-MS-Has-Attach", "yes");
// set the Date: header
msg.setSentDate(new Date());
msg.saveChanges();
// send the message
Transport.send(msg);
} catch (MessagingException mex)
mex.printStackTrace();
Exception ex = null;
if ((ex = mex.getNextException()) != null)
ex.printStackTrace();
}DEBUG SMTP: use8bit false
MAIL FROM:<[email protected]>
250 Sender <[email protected]> OK
RCPT TO:<[email protected]>
250 Recipient <[email protected]> OK
DEBUG SMTP: Verified Addresses
DEBUG SMTP: [email protected]
DATA
354 Please start mail input.
------=_Part_8_12598697.1252113081107
MIME-Version: 1.0
Content-Type: text/plain; charset='iso-8859-1'
Content-Transfer-Encoding: 7bit
Please see attached pdf report. If you experience difficulty in opening the report directly from this e-mail, first save the attachment to your local computer, and then open it from the saved location.
------=_Part_8_12598697.1252113081107
MIME-Version: 1.0
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment
JVBERi0xLjQKJeLjz9MKMiAwIG9iaiA8PC9GaWx0ZXIvRmxhdGVEZWNvZGUvVHlwZS9YT2JqZWN0
L0xlbmd0aCAxNTM3L0JpdHNQZXJDb21wb25lbnQgOC9IZWlnaHQgNDIvQ29sb3JTcGFjZVsvSW5k
ZXhlZC9EZXZpY2VSR0IgMjU1KP////f39//39/fn5//v7//n5/fe3vfW1u/OzvfOzu/GxvfGxu+9
ve+1te+tre+lpeeUlOeMjN5zc95ra95aWt5SUs5cKVwpzlxiXGLGAADOAADn7+fv9+/3//fW59YA
WhjO59bG3s6UxqWMvZyEtZRCjFoxe0pjpXtcKYRKGHM5pc61jLWca62EWpxzUpRrAGtcKZzGrTmM
WjGEUlwpe0oAUiGUvaWc1rWUzq2MxqWEvZx7tZRzrYxrpYRjnHtCpWs5nGMhlFIYe0IYjEoQczlc
YmsxAGNcKQBzMXvGnFqle1Kcc0qUa0KMY0qlczmEWkKcazF7UjGMWlwphFJcKZRaIXtKIYxSXGJz
OQBaXCkAazHW595atYQ5lGMhnFoYc0IYhEoQe0IQjErn9+/O3tbG59atzr2lxrWczrWUxq2EtZx7
[clipped]
------=_Part_8_12598697.1252113081107--
250 Mail queued for delivery.
QUIT
221 Closing connection. Good bye. -
Sap email address to receive PDF attached
Hello,
I read that you can send an interactive form (in xml or pdf) back to SAP and integrate it directly into SAP.
I saw that you can get the attached file :
[Sample Code for processing Inbound Mail with Adobe Interactive Forms|http://wiki.sdn.sap.com/wiki/display/Snippets/Sample%20Code%20for%20processing%20Inbound%20Mail%20with%20Adobe%20Interactive%20Forms]
But what I don't understand is to what email address it is supposed to be sent, and how check if it is well received in sap.
Is there a "generic" address for sap inbox, and a transaction where I can check this inbox. And how do I write in the program that I want to get email from this address.
Thank you,Hello,
you will have to set up inbound mail in your SAP system. The SAP System will have an own subdomain or own addresses that you mail server will recognize and send it to your SAP system. About setting up inbound mail please read SAP note:
#455140
After the mail arrives into the SAP system you can define which addresses will need special inbound processing. >> This is what you already found.
The inbound mails can be found in Tr. SOIN in the new releases.
Best regards,
Dezso -
This happens on every PDF I open from an email. The PDF opens fine, but when I go to save it I end up in a temporary location, which bears no resemblance to the location I was last in when I had to navigate to it. I am saving documents on a network location.
I am running Windows 7 SP1, and am using Adobe Reader 11.0.5
Any help would be greatly appreciated,
Thanks,
TaniaThis is the appropriate behavior.. Most email programs (browsers too) store attachments (or files) in a cache area. You then need to do a save as to more them to a different location. The plug-in is finding the pdf in the location determined by the email program, so that is the last place the plug-in used. It doesn’t have a different location to use.
-
AOL stripping pdf from "multipart/alternative" text email
Hi! I am using MYOB AccountEdge and it has a function within the program to send out statements as pdf attachments to a text email. As of the beginning of this year, AOL is stripping off the pdf attachment, but the text email goes through. Last year, no problem - the attachments were received.
I can send the attachment to the AOL accounts successfully if I attach it to a new text mail message from the mac Mail program.
In examining the Long Headers, it appears the only difference, I can see is that the email where the pdf attachment is stripped is "multipart/alternative" and the email where is goes through is "multipart/mixed".
As the MYOB program seems to send through Mail, at least the sent message shows up in the Sent folder, is there a way to force "multipart/mixed" through a command in Terminal? Or do I need to continue to do battle with MYOB?
Anyone else having pdf's stripped when sending a "multipart/alternative" text email to AOL?
Thanks for any help/ideas.
Peter TruceThanks for the help, Ernie. I did note that sometimes, not today, the message would take a very long time to get to my test AOL account - perhaps 12 hours, but it would eventually show up.
Of course not all of my customers use AOL and everyone else is receiving the statement emails correctly. Just AOL clients and usually they are using a PC, curiously. I have one client with a Mac who is getting them OK on her AOL account.
The brush image has been there for say, 5 years? Hopefully that is not the problem as I really, really like the brush.
I do agree with what you are suggesting: This is a MYOB problem and MYOB will have to solve it. But thanks for identifying the thing. I will be hopping on the Tech Support Desk tomorrow - can't get through by phone on Mondays usually.
Peter Truce -
How to send pdf attachment SO_NEW_DOCUMENT_ATT_SEND_API1?
Dear All,
I am using SO_NEW_DOCUMENT_ATT_SEND_API1 to send PDF attachment with some text in the body.
How to di it plz help me.
Regards,
Raj...Hi,
Refer below link
http://http://scn.sap.com/thread/3160549
http://http://scn.sap.com/community/abap/blog/2014/05/09/sending-email-with-pdf-attachment -
How do I add text message to this email with PDF attachment?
Good day, everyone!
Okay, we have a "z"-version of program RFFOUS_T and some of its include codes. One include code, RFFORIO6, has a form called MAIL_PDF_ADVICE. It is in this form that we are emailing a remittance advice form. The actual form is attached as a PDF file.
Unfortunately, there's no text in the body of the email -- it's just the attachment -- so the users would like us to add a couple basic lines in the body of the email that explain the attachment. I'm pretty new to using this particular FM and emailing the PDF attachment, and I've gotten stuck in my research trying to find out exactly how to do this. I'm guessing this shouldn't be all that difficult, but I'm not finding the right solution. Here's the form:
*& Form mail_pdf_advice
E-mail PDF advice
-->IT_ADVICE PDF form (output from Adobe server)
-->I_PDF_LEN length of PDF advice in bytes
FORM mail_pdf_advice USING it_advice TYPE solix_tab
i_pdf_len TYPE i.
DATA:
lt_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
l_user LIKE soextreci1-receiver,
ls_send_doc LIKE sodocchgi1,
lt_pdf_attach TYPE TABLE OF sopcklsti1 WITH HEADER LINE.
CHECK NOT finaa-intad IS INITIAL.
CHECK finaa-nacha EQ 'I'.
*--- determine E-Mail sender and recipient
IF fsabe-usrnam EQ space.
l_user = sy-uname.
ELSE.
l_user = fsabe-usrnam. "Office-User des Sachbearb.
ENDIF.
lt_receivers-receiver = finaa-intad.
lt_receivers-rec_type = 'U'. "E-mail address
APPEND lt_receivers.
ls_send_doc-obj_descr = itcpo-tdtitle.
lt_pdf_attach-transf_bin = 'X'.
lt_pdf_attach-doc_type = 'PDF'.
lt_pdf_attach-obj_langu = reguh-zspra.
lt_pdf_attach-body_start = 1.
lt_pdf_attach-doc_size = i_pdf_len.
DESCRIBE TABLE it_advice LINES lt_pdf_attach-body_num.
APPEND lt_pdf_attach.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_send_doc
sender_address = l_user
TABLES
packing_list = lt_pdf_attach
contents_hex = it_advice
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.
<error checking code snipped>
Does someone know how to do this? <b><REMOVED BY MODERATOR></b> Thanks so much in advance!
Dave
Message was edited by:
Alvaro Tejada GalindoHi Dave,
Table <b>contents_bin</b> is used to pass attachment file and <b>contents_txt</b> is used to pass mail body contents. You need to declare one more int table to give contents for mail body.
For reference check the code below
ut_message is for message body
and ut_attach is having attachement file.
FORM send_file_as_email_attachment TABLES ut_message
ut_attach
USING uv_email
uv_mtitle
uv_format
uv_filename
uv_attdescription
uv_sender_address
uv_sender_addres_type
CHANGING uc_error
uc_reciever.
DATA: l_error TYPE sy-subrc,
l_reciever TYPE sy-subrc,
l_mtitle LIKE sodocchgi1-obj_descr,
l_email LIKE somlreci1-receiver,
l_format TYPE so_obj_tp ,
l_attdescription TYPE so_obj_nam ,
l_attfilename TYPE so_obj_des ,
l_sender_address LIKE soextreci1-receiver,
l_sender_address_type LIKE soextreci1-adr_typ,
l_receiver LIKE sy-subrc.
DATA: lt_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
lt_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
lt_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
lt_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
lt_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
l_cnt TYPE i,
l_sent_all(1) TYPE c,
lw_doc_data LIKE sodocchgi1.
l_email = uv_email.
l_mtitle = uv_mtitle.
l_format = uv_format.
l_attdescription = uv_attdescription.
l_attfilename = uv_filename.
l_sender_address = uv_sender_address.
l_sender_address_type = uv_sender_addres_type.
Fill the document data.
lw_doc_data-doc_size = 1.
Populate the subject/generic message attributes
lw_doc_data-obj_langu = sy-langu.
lw_doc_data-obj_name = 'SAPRPT'.
lw_doc_data-obj_descr = l_mtitle.
lw_doc_data-sensitivty = 'F'.
Fill the document data and get size of attachment
CLEAR lw_doc_data.
READ TABLE ut_attach INDEX l_cnt.
lw_doc_data-doc_size =
( l_cnt - 1 ) * 255 + STRLEN( ut_attach ).
lw_doc_data-obj_langu = sy-langu.
lw_doc_data-obj_name = 'SAPRPT'.
lw_doc_data-obj_descr = l_mtitle.
lw_doc_data-sensitivty = 'F'.
CLEAR lt_attachment.
REFRESH lt_attachment.
lt_attachment[] = ut_attach[].
Describe the body of the message
CLEAR lt_packing_list.
REFRESH 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.
DESCRIBE TABLE ut_message LINES lt_packing_list-body_num.
lt_packing_list-doc_type = 'RAW'.
APPEND lt_packing_list.
Create attachment notification
lt_packing_list-transf_bin = 'X'.
lt_packing_list-head_start = 1.
lt_packing_list-head_num = 1.
lt_packing_list-body_start = 1.
DESCRIBE TABLE lt_attachment LINES lt_packing_list-body_num.
lt_packing_list-doc_type = l_format.
lt_packing_list-obj_descr = l_attdescription.
lt_packing_list-obj_name = l_attfilename.
lt_packing_list-doc_size = lt_packing_list-body_num * 255.
APPEND lt_packing_list.
Add the recipients email address
CLEAR lt_receivers.
REFRESH lt_receivers.
lt_receivers-receiver = l_email.
lt_receivers-rec_type = 'U'.
lt_receivers-com_type = 'INT'.
lt_receivers-notif_del = 'X'.
lt_receivers-notif_ndel = 'X'.
APPEND lt_receivers.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = lw_doc_data
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
sent_to_all = l_sent_all
TABLES
packing_list = lt_packing_list
contents_bin = lt_attachment
contents_txt = ut_message
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.
Message was edited by:
Amit Kumar -
PDF attachment, text disappearing once opened.
Hi Experts, I have been working on a smartform conversion to PDF email. I have inserted a gui download after the conversion process to check the pdf conversion. When opening the pdf that was downloaded, the pdf is perfect. However, once the pdf is emailed out of SAP to the microsoft exchange server and I open it in Outlook, only one block of text is present and if I scroll the page the text disappears. Has anyone encountered this problem and/or can someone help me fix it?
Thanks,
ChrisHere is my code as of right now. The PDF email is saying the pdf is damaged or could not be repaired, when I try to open it.
DATA: it_otf TYPE STANDARD TABLE OF itcoo,
it_docs TYPE STANDARD TABLE OF docs,
it_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE,
it_soli TYPE STANDARD TABLE OF tline,
it_table TYPE STANDARD TABLE OF tline,
st_job_output_info TYPE ssfcrescl,
st_document_output_info TYPE ssfcrespd,
st_job_output_options TYPE ssfcresop,
st_output_options TYPE ssfcompop,
st_control_parameters TYPE ssfctrlop,
v_len_in TYPE so_obj_len,
v_language TYPE sflangu VALUE 'E',
v_e_devtype TYPE rspoptype,
v_bin_filesize TYPE i,
v_name TYPE string,
v_path TYPE string,
v_fullpath TYPE string,
v_filter TYPE string,
v_uact TYPE i,
v_guiobj TYPE REF TO cl_gui_frontend_services,
v_filename TYPE string,
v_fm_name TYPE rs38l_fnam.
DATA: pdf_length TYPE i,
doctab TYPE TABLE OF docs.
DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
i_tline TYPE TABLE OF tline WITH HEADER LINE,
i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE.
Objects to send mail.
DATA: i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
it_mess LIKE solisti1 OCCURS 0 WITH HEADER LINE,
wa_doc_data TYPE TABLE OF sodocchgi1 WITH HEADER LINE,
it_pcklist TYPE TABLE OF sopcklsti1 WITH HEADER LINE,
it_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
tripdata TYPE zps_appr_dissappr_wf,
ziflo TYPE iflo.
Work Area declarations
DATA: wa_objhead TYPE soli_tab,
w_ctrlop TYPE ssfctrlop,
w_compop TYPE ssfcompop,
w_return TYPE ssfcrescl,
wa_doc_chng TYPE sodocchgi1,
w_data TYPE sodocchgi1,
wa_buffer TYPE string."To convert from 132 to 255
Variables declarations
DATA: v_form_name TYPE rs38l_fnam,
v_len_out LIKE sood-objlen,
v_len_outn TYPE i,
v_lines_txt TYPE i,
v_lines_bin TYPE i,
v_lines TYPE i.
DATA: itcpo LIKE itcpo,
tab_lines LIKE sy-tabix.
Variables for EMAIL functionality
DATA: maildata LIKE sodocchgi1.
DATA: mailpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
DATA: mailhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
DATA: mailbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
DATA: mailrec LIKE somlrec90 OCCURS 0 WITH HEADER LINE.
DATA: solisti1 LIKE solisti1 OCCURS 0 WITH HEADER LINE.
*& Form smartform_email
text
-->C_FORMNAME text
FORM smartform_email USING c_formname.
CALL FUNCTION 'SSF_GET_DEVICE_TYPE'
EXPORTING
i_language = v_language
i_application = 'SAPDEFAULT'
IMPORTING
e_devtype = v_e_devtype.
st_output_options-tdprinter = v_e_devtype.
*st_output_options-tdprinter = 'locl'.
st_control_parameters-no_dialog = 'X'.
st_control_parameters-getotf = 'X'.
.................GET SMARTFORM FUNCTION MODULE NAME.................
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = c_formname
IMPORTING
fm_name = v_fm_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
...........................CALL SMARTFORM............................
CALL FUNCTION v_fm_name
EXPORTING
control_parameters = st_control_parameters
output_options = st_output_options
tripdata = zps_appr_dissappr_wf
ziflo = iflo
IMPORTING
document_output_info = st_document_output_info
job_output_info = st_job_output_info
job_output_options = st_job_output_options
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ELSE.
.........................CONVERT TO OTF TO PDF.......................
CALL FUNCTION 'CONVERT_OTF_2_PDF'
IMPORTING
bin_filesize = v_bin_filesize
TABLES
otf = st_job_output_info-otfdata
doctab_archive = it_docs
lines = it_lines
EXCEPTIONS
err_conv_not_possible = 1
err_otf_mc_noendmarker = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
........................GET THE FILE NAME TO STORE....................
CONCATENATE 'Field Trip' '.pdf' INTO v_name.
CREATE OBJECT v_guiobj.
CALL METHOD v_guiobj->file_save_dialog
EXPORTING
default_extension = 'pdf'
default_file_name = v_name
file_filter = v_filter
CHANGING
filename = v_name
path = v_path
fullpath = v_fullpath
user_action = v_uact.
IF v_uact = v_guiobj->action_cancel.
EXIT.
ENDIF.
..................................DOWNLOAD AS FILE....................
MOVE v_fullpath TO v_filename.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_bin_filesize
filename = v_filename
filetype = 'BIN'
TABLES
data_tab = it_lines
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
convert pdf from 132 to 255.
LOOP AT it_lines.
TRANSLATE it_lines USING '~'.
CONCATENATE wa_buffer it_lines INTO wa_buffer.
ENDLOOP.
TRANSLATE wa_buffer USING '~'.
DO.
i_record = wa_buffer.
APPEND i_record.
SHIFT wa_buffer LEFT BY 255 PLACES.
IF wa_buffer IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Attachment
REFRESH:
i_reclist,
i_objtxt,
i_objbin,
i_objpack.
CLEAR wa_objhead.
i_objbin[] = i_record[].
Create Message Body
Title and Description
i_objtxt = 'test with pdf-Attachment!'.
APPEND i_objtxt.
DESCRIBE TABLE i_objtxt LINES v_lines_txt.
READ TABLE i_objtxt INDEX v_lines_txt.
wa_doc_chng-obj_name = 'smartform'.
wa_doc_chng-expiry_dat = sy-datum + 10.
wa_doc_chng-obj_descr = 'smartform'.
wa_doc_chng-sensitivty = 'F'.
wa_doc_chng-doc_size = v_lines_txt * 255.
Main Text
wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
CLEAR i_objpack-transf_bin.
i_objpack-head_start = 1.
i_objpack-head_num = 0.
i_objpack-body_start = 1.
i_objpack-body_num = v_lines_txt.
Attachment
(pdf-Attachment)
i_objpack-transf_bin = 'X'.
DESCRIBE TABLE i_objbin LINES v_lines_bin.
READ TABLE i_objbin INDEX v_lines_bin.
i_objpack-doc_size = v_lines_bin * 255 .
i_objpack-body_num = v_lines_bin.
i_objpack-doc_type = 'PDF'.
i_objpack-obj_name = 'smart'.
i_objpack-obj_descr = 'test'.
APPEND i_objpack.
CLEAR i_reclist.
i_reclist-receiver = '[email protected]'.
i_reclist-rec_type = 'U'.
APPEND i_reclist.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = wa_doc_chng
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = i_objpack
object_header = wa_objhead
contents_bin = i_objbin
contents_txt = i_objtxt
receivers = i_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
ENDFORM. "smartform_email -
I recently purchased an Iphone 6plus and I am receiving pdf attachments that are shown as winmail.dat attachments on the iphone. When I check the same e-mail on my macbook pro the attachment is a pdf and I can open it. Why is this happening?
I had this problem too after i upgdatd to OS X Mavericks... only the songs on my iphone 5s that i purchased from itunes would play.
i read something about it being a syncing issue. when you plug your phone into your computer with the usb cable, the person said to switch from automatic syncing of itunes to the "manual" option. mine was already set to manual so i wasn't sure anything would work. BUT, when i plugged my phone into my computer, it started to sync all of my music on my phone again (top of itunes bar where song playing/time is listed said "now syncing 123/534 songs to x's iphone"). once that was completed, i checked the music app on my iphone and everything was back to normal!
so, i would suggest setting your music syncing settings to manual if you haven't tried that yet!
hope this helps! -
Receive mail with PDF attachment into XI and send to ABAP proxy
Hi,
I have a scenario where I need to receive a mail into XI that has a PDF attachment. This attachment needs to be retained as ultimately I need to send the message into CRM via an ABAP proxy and read the attachment and load against a business partner.
However, as I am only on SP13 I do not have the parameters such "Keep Attachments" available to use.
So I have two questions:
1. How do I receive the mail into XI with the PDF attachment ?
2. How do I read the attachment in an ABAP proxy ?
Any guidance in either question would be appreciated.
Cheers
Colin.hi,
you say that there's no keep attachment
indicator but does the XI store the attachment or not?
maybe it stores all attachmens
(I work with sp16 and I don't remember how it worked with sp13)
but try maybe it accepts attachments by default
then it would be quite easy
if you use then use the attachement in abap proxy
(like I said you won't have to use any java)
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
In my Mac Mail Version 4.5, I am not received email pdf attachement. It is shown in some html like form in message content. Please help
Erdygirl please be aware you are posting to a public forum. I have removed your personal information from your previous post.
Please check your account at http://www.adobe.com/ to locate your serial number. You can find more information on how to locate your serial number at Find your serial number quickly - http://helpx.adobe.com/x-productkb/global/find-serial-number.html. -
If email has a PDF attachment, I can't read the text portion of the email
I noticed that if the message had a PDF attachment, then that icon is all I see. The text portion seems to have been ignored, although I can see it in the "preview" of the message. Very strange.
Rgds
KenHave you tried to restart the phone? And how big is the PDF?
-
Mail Receiver and Attachment Issue - how to get an attachment into the body
I have an abap proxy that sends a simple message to XI with a pdf attachment. XI maps the xml message to the Mail Adapters Mail Package format.
To have the email sent with the PDF attachment I must click the "keep attachments" option. However this also has the side-effect of making the message payload an attachment as well (seems silly?). Therefore I get an email with two attachments: one is the PDF and the other is the plain text that should be in the email body.
The question is: How do I get that plain text attachment back into the Message Body ? I have tried all combinations of the MessageTranformBean and the PayloadSwapBean with no luck.
I can easily change the names of the attachments with the MessageTransformBean but if I set the text attachment to Transform.ContentDisposition inline, it still just comes out as an attachment. And, if I use the payloadswapbean the adapter log says it corectly swapped the right payload however the email still comes out with the text as an attachment!!
Any ideas on how I can do this? Is it a bug in the module beans?
(I'm using MS Outlook as the email client.)
Maybe I need to write my own module bean to do this... If I set keep attachments to OFF, can I still set the PDF attachment with my own modules (the reason I ask this is that with keep-attachment OFF, the message body correctly has the text in it...
Regards,
Jason.
Edited by: Jason Scott on Mar 6, 2008 3:22 AMHi,
Check these
/people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
/people/michal.krawczyk2/blog/2005/03/07/mail-adapter-xi--how-to-implement-dynamic-mail-address
/people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/1685 [original link is broken] [original link is broken] [original link is broken]
/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure
http://help.sap.com/saphelp_nw04/helpdata/en/3c/b4a6490a08cd41a8c91759c3d2f401/content.htm
Regards
Seshagiri -
Mail attachments showing up as garbled inline text (code)
Running 10.5.6 with Mail 3.5
Receiving attachments to emails is inconsistent. Sometimes a Word document is received with an email just fine. Other times it will be attached by the sender (in the usual manner) but will show up in my email as inline text (just garbled text or code). If the email is sent to my gmail account, the Word doc is fine.
I am not sure what to look for since the symptoms seem to be inconsistent.I have had the same problem for a long time. What burns me up is that I think I understand it, and there isn't a darn thing I can do about it --- short of using a different email client.
Examine one of these emails with the garbled text in place of attachment. If you're having the same problem I am, then when you use view -> message -> raw source, just before the attachment you will see something like this:
Content-Disposition: inline;
Multi-part MIME format messages can specify whether their sub-parts are meant to be viewed inline. If it is inline, often Mail will render images and PDF documents as you might expect, but many other file types are rendered as plain text. This even happens with files generated by applications Apple ought to be smarter about, such as iCal. I suppose that from Apple's point of view, the fault lies elsewhere. The sender's email client ought to be smart enough to let them send attachments as attachments. Unfortunately, some mail clients (Thunderbird in particular) seem to always mark outgoing attachments as inline, and Apple Mail does not have the flexibility to treat it in any other way. -
PDF attachment does not show in Mail
When I receive a mail with PDF attachment, I can't see any icon or inline text. Can anyone advice?
All of my mail accounts either show the icon or the file itself in the Mail App. Try these simple things first.
Restart the iPad by holding down on the sleep button at the top of the iPad until the red slider appears, then slide to the right to power off the iPad. Turn the iPad on again by pressing the sleep button until the Apple logo appears. Once the iPad has fully rebooted, open Mail to relaunch.
Try a hard reset by pressing and holding down on the sleep button at the top of the iPad while holding down on the home button at the bottom, until the Apple logo appears and the iPad restarts. Launch Mail again and see what happens.
Message was edited by: Demo
Maybe you are looking for
-
i restored my iPod touch and when it restarted it either freezes or loops in a restart mode. why?
-
Hi All, I have to do a ALV with variable no. of columns. i.e Depending on the data , the columns should get populated. Thanks in advance. Dnyanesh
-
I have photo stream running on my Mac within Aperture. There are 2 iPhones, 1 iPad and 2 Macs coupled to the iCloud. Is it possible to see on a Mac from which iDevice the picture is originating (eg: the iPhone name)? Now it just shows the picture is
-
Download link for design premium cs5.5
I just got a new computer for graduation and I have the creative suite on my laptop and i wanted to put it on my new computer but i still cant find the proper link to download my 2nd download of my design premuim cs5.5 the costumer service has been z
-
Why GSEventLockDevice() not working in ios 7?
Why GSEventLockDevice() not working in ios 7?