Problem send attachment with mail

Hello,
I'm coding a program which sends a mail with attachment to an external mail address. The system creates the mail and the attachment, bu the content of the attachment isn 't correct.
this is my code
REPORT  Z_SEND_MAIL.
data: IS_DOCDATA type SODOCCHGI1,
IS_RECEIVERS type SOMLRECI1,
IS_RECEIVERS_COPY type SOMLRECI1,
IT_RECEIVERS type table of SOMLRECI1,
IS_CONTENT type SOLISTI1,
IT_CONTENT type table of SOLISTI1,
*500369789+
l_txt(255) type c,
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,
l_tab_lines TYPE i,
l_att_type LIKE soodk-objtp.
*500369789+
IS_DOCDATA-OBJ_NAME = 'MAIL'.
IS_DOCDATA-PRIORITY = 5.
IS_DOCDATA-OBJ_LANGU = SY-LANGU.
IS_DOCDATA-NO_CHANGE = 'X'.
IS_DOCDATA-OBJ_DESCR = SY-CPROG.
clear : IS_CONTENT, l_txt. "500369789+
move '123456789' to l_txt. "500369789+
* move IS_MESSAGE-LINE to IS_CONTENT-LINE. "500369789-
move l_txt to IS_CONTENT-LINE. "500369789+
append IS_CONTENT to IT_CONTENT.
*add receiver
IS_RECEIVERS-RECEIVER = '[email protected]'.
IS_RECEIVERS-REC_TYPE = 'U'.
append IS_RECEIVERS to IT_RECEIVERS.
lt_objhead-line = 'Test mail'.
append lt_objhead.
DESCRIBE TABLE lt_objhead LINES l_tab_lines.
CLEAR lt_objpack-transf_bin.
lt_objpack-doc_size = STRLEN( lt_objhead ).
lt_objpack-head_start = 1.
lt_objpack-head_num = 1.
lt_objpack-body_start = 1.
lt_objpack-body_num = 1.
lt_objpack-doc_type = 'RAW'.
APPEND lt_objpack.
l_att_type = 'TXT'.
DESCRIBE TABLE it_content LINES l_tab_lines.
READ TABLE it_content into is_content INDEX l_tab_lines.
lt_objpack-doc_size = ( l_tab_lines - 1 ) * 255.
lt_objpack-doc_size = lt_objpack-doc_size + STRLEN( is_content ).
lt_objpack-transf_bin = 'X'.
lt_objpack-head_start = 1.
lt_objpack-head_num = 2.
lt_objpack-body_start = 1.
lt_objpack-body_num = l_tab_lines.
lt_objpack-doc_type = l_att_type.
lt_objpack-obj_name = 'ATTACHMENT'.
concatenate 'Test' SY-DATUM+6(2) SY-DATUM+4(2) into
lt_objpack-obj_descr. "#EC *
APPEND lt_objpack.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = IS_DOCDATA
commit_work = 'X'
TABLES
packing_list = lt_objpack
* object_header = lt_objhead
contents_txt = lt_objhead
contents_bin = it_content
receivers = it_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
The attachment is a TXT, the content should be '123456789', but it is '1 2 3 4'.
Does anyone has an idea why he does this ?
thanks !

solved by a colleague

Similar Messages

  • Getting: Unable to send attachment with Mail Drop

    Mail Drop is not working for me, I always get error message while trying to send.
    Here is what happens:
    -I compose a message that includes a large attachment
    -I click send
    -I get the message "Unable to send attachment with Mail Drop" for a few seconds
    -My message is not sent and it goes into the Outbox folder.
    Configuration:
    OS X 10.10 Yosemite
    Mail -> Preferences -> Accounts -> Advanced. The option "Send large attachments with Mail Drop" is selected.

    I had the exact same problem.  I finally figured out what was wrong.  I believe you must have iCloud Drive turned on in System Preferences AND you also must allow mail to store document in iCloud Drive which you can check by clicking the "Options..." button in the preference pane of iCloud Drive. As you can see below.

  • Problem sending attachements with gmail account on mail

    Hello:
    I have a lot of problems sending attachments with my gmail account using mail.
    1. Attachments are not big.
    2. I don't have the same problem with other non gmail accounts.
    3. When ever I have this problem I go to gamil.com and I am able to send the attachment with no problem.
    Any suggestions?
    Thanks

    No idea ?
    Nemrod

  • Problem receiving attachment with Mail 5.1

    Hi all,
    Just got the New Macbook Pro 15". Superb machine!
    But since i set up my Mail account on Mail 5.1, I can receive and send mails... but have problems opening attachements.
    It tells me that there have been a problem with the file and that It has crashed.
    I don't have any problems when I open the same mail from my internet provider site.
    Any suggestions are welcome.
    Thank you in advance
    Julien

    solved by a colleague

  • Send attachment with mail

    Hi all,
    I am using Oracle Database 10g Enterprise Edition Release 10.1.0.2.0. I am sending MULTIPART mail contains HTML +Attachment. When I send mail to any E mail id of my own domain (eg. [email protected]) , then that user will get both message and attachment. But when i send same mail to other domain (eg. [email protected] or [email protected]), then that user will get only message and NOT attachment. Why this is so? Please help.
    Someone suggested me to use following code, but prob is not solved.
    UTL_SMTP.COMMAND(V_CONN, 'AUTH LOGIN');
    UTL_SMTP.COMMAND(V_CONN,UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(UTL_RAW.CAST_TO_RAW(V_USERNAME))));
    UTL_SMTP.COMMAND(V_CONN,UTL_RAW.CAST_TO_VARCHAR2(UTL_ENCODE.BASE64_ENCODE(UTL_RAW.CAST_TO_RAW(V_PASSWORD))));
    Please help me.
    Thank you

    here is a sample program.
    I have used this program to send in attachments.
    http://www.akadia.com/services/java_mail_plsql.html
    Also modified the program to send text in the body. Current limit i think is 32k. You can increase this by modifing the java program to accept blob.
    Hope this helps.
    Alvinder

  • I'm not able to send emails with mail.ru. Receiving and reading is not a problem. When I create a email with mail.ru its not possible to send it although its stored in my mail.ru account as "still to be send". What can it be??

    I'm not able to send emails with mail.ru. Receiving is not a problem. Creating a mail is also not a problem and the mail will be stored at mail.ru as still to be send, only problem is its not possible to send. I noticed the buttons for sending change colour when used but they don't perform. What it is?

    Don't know what changed, but all of a sudden able to send emails by mail.ru ...... sorry for bothering.

  • TS3276 I can send emails with Mail but can no longer receive them. Yet I haven't altered anything.  How do I solve this problem. Thanks

    I can send emails with Mail but can no longer receive them. Yet I haven't altered anything.  How do I solve this problem. Thanks

    Who is your email provider? Have you set up your account manually or was it set up automatically?

  • Problems sending emails with iPhone 3G and outlook exchange

    I have a problem sending email with exchange. Receiving and answering mail works fine and calender updates work fine. However when I initiate an email from the phone it syncs and ends up in the sent folder in the computer but never reaches the recipient. I have tried this many times with different recipients and phones. It only happens from my iphone and ipad. Any suggestions?
    Any help much appreciated

    The iPhone you returned is still syncing against your server and locking out your account. Someone possibly has access to your mail data. I'd recommend having your Exchange Administrator install the Microsoft Exchange Server ActiveSync Web Administration Tool (http://www.microsoft.com/downloads/details.aspx?FamilyID=E6851D23-D145-4DBF-A2CC -E0B4C6301453&displaylang=en) and attempt to wipe/delete/block that other iPhone.
    Message was edited by: ethanm

  • Send attachment with maximum characters

    I need to extract data from a table into a .csv and then send that .csv as an attachment.
    I am converting the data to csv and assigning it to clob variable but table has huge data therefore procedure gets error out after around 7000 characters with
    ORA-06502: PL/SQL: numeric or value error.
    Please suggest a way to send attachment with maximum characters.
    With the below sample code i am able to send atttachement upto 7000 characters.
    DECLARE
    v_From VARCHAR2(80) := '[email protected]';
    v_Recipient VARCHAR2(80) := '[email protected]';
    v_Subject VARCHAR2(80) := 'test subject';
    v_Mail_Host VARCHAR2(30) := 'mail.mycompany.com';
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    v_message clob;
    BEGIN
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    utl_smtp.Data(v_Mail_Conn,
    'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf ||
    'MIME-Version: 1.0'|| crlf ||     -- Use MIME mail standard
    'Content-Type: multipart/mixed;'|| crlf ||
    ' boundary="-----SECBOUND"'|| crlf ||
    crlf ||
    '-------SECBOUND'|| crlf ||
    'Content-Type: text/plain;'|| crlf ||
    'Content-Transfer_Encoding: 7bit'|| crlf ||
    crlf ||
    'some message text'|| crlf ||     -- Message body
    'more message text'|| crlf ||
    crlf ||
    '-------SECBOUND'|| crlf ||
    'Content-Type: text/plain;'|| crlf ||
    ' name="excel.csv"'|| crlf ||
    'Content-Transfer_Encoding: 8bit'|| crlf ||
    'Content-Disposition: attachment;'|| crlf ||
    ' filename="excel.csv"'|| crlf ||
    crlf ||
    v_message|| crlf ||     -- Content of attachment
    crlf ||
    '-------SECBOUND--'               -- End MIME mail
    utl_smtp.Quit(v_mail_conn);
    EXCEPTION
    WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
    raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
    END;
    Thanks,

    Thanks for your help Billy.
    I am able to segment the data but I am not getting any attachment instead segmented data is showing in the mail body.
    Can you please have a look and let me where it is going wrong?
    DECLARE
    v_From VARCHAR2(80) := '[email protected]';
    v_Recipient VARCHAR2(80) := '[email protected]';
    v_Subject VARCHAR2(80) := 'test mail';
    v_Mail_Host VARCHAR2(30) := 'localhost';
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    v_message clob;
    message clob;
    BEGIN
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    v_message := 'date: ' || to_char(sysdate, 'DD-MON-YYYY HH24:MI:SS')||chr(10)||
    'from: '||v_From|| chr(10) ||
    'to: '||v_Recipient ||chr(10)||
    'subject: '||v_Subject || chr(10) || chr(10);
    utl_smtp.open_data (v_Mail_Conn);
    utl_smtp.write_data(v_Mail_Conn , v_message );
    --MIME header.
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,'MIME-Version: 1.0' || crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,'Content-Type: multipart/mixed;' || crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,' boundary="-----SECBOUND"' ||crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,crlf);
    -- Mail Body
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,'-------SECBOUND'|| crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,'Content-Type: text/plain;' || crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn,'Content-Transfer_Encoding: 7bit' || crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn, crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn, 'Please see the attachments' || crlf);
    UTL_SMTP.WRITE_DATA(v_Mail_Conn, crlf);
    -- Mail Attachment
    utl_smtp.write_data(v_Mail_Conn,'-------SECBOUND' || crlf);
    utl_smtp.write_data(v_Mail_Conn,'Content-Type: text/plain;' || crlf);
    utl_smtp.write_data(v_Mail_Conn,'name="excel.csv"' ||crlf);
    utl_smtp.write_data(v_Mail_Conn,'Content-Transfer_Encoding: 8bit' ||crlf);
    utl_smtp.write_data(v_Mail_Conn,'Content-Disposition: attachment;' ||crlf);
    utl_smtp.write_data(v_Mail_Conn,'filename="excel.csv"' ||crlf);
    utl_smtp.write_data(v_Mail_Conn,crlf);
    message := 'OBJECT_TYPE, OBJECT_FOREIGNKEY, OPERATION, EVENT_ID, STATUS_ID, NUM_BLOCKED, MODIFIED_DATE, INT_UPDATEEVENT_FMWID, ERROR_DESCRIPTION';
    utl_smtp.write_data(v_Mail_Conn , message );
    for rec in (
    select object_type, object_foreignkey, operation, x.event_id, x.status_id, num_blocked,
    e.modified_date, e.INT_UPDATEEVENT_FMWID, replace(substr(e.error_description,1,100),',',' ') error_description
    from (
    select b2.object_type, b2.object_foreignkey, t.operation, e2.event_id, e2.status_id, count(1) num_blocked
    from EVENT e
    INNER JOIN TRANSACTION t
    ON e.transaction_id = t.transaction_id
    inner join transaction_dependency d
    on t.transaction_id = d.transaction_id
    inner join transaction_block b
    on t.transaction_id = b.transaction_id
    inner join transaction_block b2
    on d.transaction_id <> b2.transaction_id
    and d.object_type = b2.object_type
    and d.object_foreignkey = b2.object_foreignkey
    inner join transaction t2
    on b2.transaction_id = t2.transaction_id
    and t.source_type = t2.source_type
    inner join event e2
    on t2.transaction_id = e2.transaction_id
    where t.source_type = 'CRM_OD_To_OP'
    and e.created_date >=(sysdate - 1)
    and e.status_id <1000
    and e2.status_id <1000
    group by b2.object_type, b2.object_foreignkey, t.operation, e2.event_id, e2.status_id
    ) x
    inner join event e
    on x.event_id = e.event_id
    and e.status_id = 900
    order by num_blocked desc, object_type, object_foreignkey
    ) loop
    message := crlf || rec.object_type||','||rec.object_foreignkey||','|| rec.operation|| ','|| rec.event_id||
    ','||rec.status_id||','||rec.num_blocked||','||rec.modified_date||','||rec.INT_UPDATEEVENT_FMWID||','||rec.error_description;
    utl_smtp.write_data(v_Mail_Conn , message );
    end loop;
    utl_smtp.write_data(v_Mail_Conn,crlf);
    utl_smtp.write_data(v_Mail_Conn,'-------SECBOUND');
    utl_smtp.close_data(v_mail_conn);
    utl_smtp.quit( v_mail_conn );
    EXCEPTION
    WHEN others then
    dbms_output.put_line('error ' || sqlerrm);
    END;

  • TS3276 I can't send messages with mail 6.0 of mountain lion, because I can't desactivate the option SSL (Secure sockets Layers); it is locked

    I can't send messages with mail 6.0 of mountain lion, because I can't desactivate the option SSL (Secure sockets Layers); it is locked

    Hi, i am having the same problem. this is what i have noticed.
    I have 2 x imac's and 2 x macbook air's
    i upgraded the 2 macbook air's and 1 of the imac's to Mountain Lion, all these have problems acessing sites that require you to login .
    the one remaining imac is still running lion and works perfect.
    i am using a dlink router with DD-WRT firmware, i tested teathering from my iphone and i can log into websites fine using the newly upgraded mac's.
    It's not a wireless issue as my imac is using an ethernet connection.
    is there a compatibility issue with some routers.

  • The problem I have since I upgraded to Mavericks version 10.9.1 The problem appears only with Mail not with other programs, not even with my browser. When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command   to e

    the problem I have since I upgraded to Mavericks version 10.9.1
    The problem appears only with Mail not with other programs, not even with my browser.
    When I try to zoom the text of an e-mail I received or sent , I can no longer use the keys Command + to enlarge the text, although I can reduce it with Command -.
    As I have a problem with my eyes, This is a serious matter for me.
    When I write an e-mail, if I select text and press Command +, it just displaces the text to the right.
    Now, my husband has a USB keyboard. If he connects it to my computer, his regular Command + does not work either, but  he uses the extended keyboard, then it works. Unfortunately, he needs it for a musical application which does not work with a wireless keyboard.

    Firefox 3.6.4 and 3.6.6 use a process called, "plugin-container.exe" which was using up most of my CPU when I opened up multiple tabs that contained Adobe Flash files, and caused Firefox to lock up.
    My solution was to use Firefox 3.5.10 which you can get from the Mozilla website at [http://www.mozilla.com/en-US/firefox/all-older.html]
    I am using Adobe Flash 10.1.53.64 without any problem in this version of Firefox. Check the release notes, I believe it contains all the latest security fixes in "Firefox 3.6.4".
    Hopefully, they will fix Firefox 3.6 in the next version (e.g. Firefox 3.6.7), until then you should probably use "Firefox 3.5.10".

  • Unable to send pictures with mail from iPhoto

    Since yesterday i cannot use iPhoto to send pictures with mail, it just does not open a new mesage in mail. can you help me please? have done cleaning tasks and repeired permissions already. thank you.

    Does anything happen?
    Have you deleted the iPhoto Preference file - A good general step for strange issues is to renew the iPhoto preference file - quit iPhoto and go to "your user name" ==> library ==> preferences ==> com.apple.iPhoto.plist and trash it - launch iPhoto which creates a fresh new default preference file and reset any personal preferences you have changed and if you have moved the iPhoto library repoint to it. This may help
    LN

  • Sending attachment with different name

    Hi,
    is it possible to send attachment with different name with javaMail?
    If possible, is there a sample code to do it?
    Thanks.
    Edited by: user1071181 on Aug 6, 2011 2:14 PM

    Hi,
    I listed some of my code at below.
    But i did not find attachFile method for messageBodyPart class.          
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setDataHandler(new DataHandler(new MemoryDataSource(....getPDFObject())));
    messageBodyPart.attachFile("abc.pdf");
    messageBodyPart.setFileName("abc_2011_08_07.pdf");
    messageBodyPart.setHeader("Content-Type", "application/pdf");
    multipart.addBodyPart(messageBodyPart);
    message.setContent(multipart);

  • PO Attachment with mail.

    Hi all,
    Right now I am functioning on Oracle finance and I am stuck .I will grateful if you make available me any solution or any hint.
    Step:
    1)     User will create PO orders .
    2)     He/She will approve PO orders.
    3)     After User will attaché couple of Document e.g. *.doc,*.els etc…with this PO Orders.
    4)     Now once user will click on approve button standard orders will sent to supplier with attached PDF(this PDF file will create Oracle internally and attached with mail) file.
    Que : Here supplier will get email with only standard attachment not all other *.doc and *.els with is attached with current order. I would like to change this development and want to attach all attachment along with Stand orders PDF.
    Note : This process is calling one JAVA Concurrent Prog : (PO Output for Communication)
    Thanks Looking for response.
    Thanks
    Raj

    Hi all,
    Right now I am functioning on Oracle finance and I am stuck .I will grateful if you make available me any solution or any hint.
    Step:
    1)     User will create PO orders .
    2)     He/She will approve PO orders.
    3)     After User will attaché couple of Document e.g. *.doc,*.els etc…with this PO Orders.
    4)     Now once user will click on approve button standard orders will sent to supplier with attached PDF(this PDF file will create Oracle internally and attached with mail) file.
    Que : Here supplier will get email with only standard attachment not all other *.doc and *.els with is attached with current order. I would like to change this development and want to attach all attachment along with Stand orders PDF.
    Note : This process is calling one JAVA Concurrent Prog : (PO Output for Communication)
    Thanks Looking for response.
    Thanks
    Raj

  • Can we send attachements with Idoc?

    Hi ,
    Can we send attachements with Idoc?

    Hi,
    1. in standard you cannot
    2. you could however send it in a text field
    and then combine in adapter or java proxy
    on the other hand abap proxies work with attachments
    in standard - check out my blog:
    /people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
    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>

Maybe you are looking for