Sending Emails with Attachments greater than 255 chars in 4.6C

Hi,
I have a requirement in which i have to send mails with attachments greater than 255 characters. The attachment would be a tab-delimited .TXT file. Since i am working on 4.6C, i don't have the luxury of using the FM 'SCMS_STRING_TO_FTEXT'.
It's very urgent. So any help in this regards would be greatly appreciated.
Thank you.
Balaji

Hi,
Internal table to be passed to SOLIST1 type int, table and then compress this table using fm "table_compress" with the compressed table then call fm "table_decompress" and pass this to function module SO_NEW_DOCUMENT_ATT_SEND_API1.
Keep in mind the following variable
i_packing_list-transf_bin = 'X'.
aRs

Similar Messages

  • @ FM to send email with width greater than 128 chars

    Hi
    Is there a FM which would send an e-mail with width greater than 128 chars.
    Z-Send_email_attachemnt would limit the witdth to 128 char due to table EMAIL_TEXT LIKE table BTCXPGLOG.
    BTCXPGLOG- field- Message(128)
    Thanks.

    Hi,
    look in SE38 with BCS_EXAMPLE_*
    I can use 255 char.
    Regards, Dieter

  • Send an attachment in email with length more than 255 char per line

    Hi All,
    I have to send an attachment in email with length more than 255 char per line. I dont want to break the line after 255 char and add it in another line.
    Please suggest me any function module which can perform this.
    Thank you all.

    I looked at all threads in the forum, there was about 5 or 6 identical questions, but surprise, nobody knows! It seems that SO_NEW_DOCUMENT_ATT_SEND_API1 function module does not allow more than 255 characters by line.
    It would surprise me a lot if there is no workaround !
    As it is very easy to add any binary attachment which is like a very long line, PDF for example (several kilobytes), via the function module above (lots of examples in the forum), I would advise you to try to use the same way, i.e. use the contents_bin parameter instead of the contents_txt parameter (convert the text into binary) and add the line feeds yourself (okay I know, it's not very smart).
    Last thing, this function module is deprecated, and we should use BCS classes, maybe they work better.

  • Email attachment rows greater than 255 char get truncated

    Hi
    I am trying to code in 4.6C to email excel attachment with rows greater than 255, and the rows are being truncated using function module SO_NEW_DOCUMENT_ATT_SEND_API1.
    I have searched the forum and can not find an actual solution to this on a 4.6c system.
    Firstly is it possible to send an excel attachment with rows that have rows greater than 255, and secondly if yes have anyone seen any sample code which does this?
    Many thanks
    Daniel

    Hai! Check this coding out
    Here the internal table l_tab_attach is temporary table which has a line size more than 255 chars.
    Data: begin of l_tab_attach occurs 0,
            line(300),  "give what ever char length u want as a output
            end of l_tab_attach
    *concatenate all the header column and the its corresponding entries ie rows in this table l_tab_attach.
    peform send_email table t_message
                                        l_tab_attach
    'FORM send_file_as_email_attachment TABLES pit_message
                                              pit_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,
            w_new_obj_id TYPE sofolenti1-object_id,
            t_objhead TYPE STANDARD TABLE OF solisti1 WITH HEADER LINE.
      ld_mtitle              = eml_subj.
      ld_format              = 'XLS'.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = att_nam.
      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 l_tab_attach INDEX w_cnt.
      w_doc_data-doc_size =
         <b>( w_cnt - 1 ) * 255 + STRLEN( L_TAB_ATTACH-LINE ).</b>"this is important for lenght exceeding more that 255 char
      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[] = pit_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 l_tab_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.
      REFRESH t_receivers.
      LOOP AT mailto.
    Add the recipients email address
        CLEAR t_receivers.
        t_receivers-receiver = mailto+3(48).
        t_receivers-rec_type = 'U'.
        t_receivers-com_type = 'INT'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
      ENDLOOP.
      CLEAR t_objhead.
      REFRESH t_objhead.
      t_objhead = att_nam.
      APPEND t_objhead.
      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               = l_tab_message
          receivers                  = t_receivers
          object_header              = t_objhead
        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.                    " SEND_FILE_AS_EMAIL_ATTACHMENT
    <b>Dont forget to give points if useful</b>

  • Unable to send messages with attachments greater than 5 Mb using iPad 2

    Hello
    We are running into an issue in our organization where messages forwarded or composed from an iPad 2 ( iOS 6.1.0.3) with an attachment greater than 5 Mb fail to send.
    iOS devices connect through MobileIron into Exchange 2010 SP1 RU8. Our message restriction on the Exchange end is 25 Mb.
    Our MobileIron support team has ruled out any issue on their end. We cannot determine if the matter resides with the devide or Exchange, though we are suspecting the device.
    We are able to forward or compose messages up to 5 Mb without an issue. We have also been able to receive different attachments up to 17 Mb without too much trouble, the exception being a 12 Mb MP4 video. The 12 Mb MP4 file would not download. This is why we're suspecting a device issue.
    Has anyone run into something similar?

    Are you certain it is not a limitation with your SMTP-server? OR the receiving end of your larger-than-10MB message?
    Try and send a big one to yourself. If it doesn't work, try a free SMTP server.

  • How can i send an email with subject more than 50 char.

    Hi
    Can you please explain How can i send an email with subject more than 50 char?? I am using Cl_BCS=>SET_MESSAGE_SUBJECT but it is throwing an error " An exception of the type CX_SY_REF_IS_INITIAL has occured which is not caught" .
    Regards
    Alok

    Try using the following FM
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = i_mail_data
            put_in_outbox              = c_x
          TABLES
            packing_list               = i_objpack[]
            object_header              = i_objhead[]
            contents_bin               = i_objbin[]
            contents_txt               = i_objtxt[]
            receivers                  = i_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.
    Regards
    Avinash
    Edited by: Avinash Jagtap on Dec 2, 2009 7:00 AM
    Edited by: Avinash Jagtap on Dec 2, 2009 7:02 AM

  • In Exchange 2013 i cannot open mails with attachments greater than 19.6 MB in EWS or OWA

    Hello,
    i have in Exchange 2013 CU3 on Windows 2012 the following problem :
    When backup mails using EWS i get the message " EWS Error Code : ErrorMessageSizeExceeded." in mails with attachments greater than 20.137 KB ( 19.6 MB).
    Then I checked all the settings of the EWS , but the defaults are already significantly higher than these 19.6 MB (Base64 approximately 26.5 MB)
    web.config ( maxAllowedContentLength = " 85000000 ").
    Settings of the MaxSendSize and ReceiveSize are 300MB .
    All requestfiltering settings in IIS are set to 85MB.
    When i access via EMS or OWA , file attachments over 19.6 MB can not be opened .
    However, the preview shows in OWA the correct mail including attachment and it can be saved from the preview up to the set maximum size.
    By double clicking on an email in OWA bigger than 19.6 MB i get the following error message:
    "Error : Your request can not be completed right now Please try again later . . "
    Send and receive mail can also be up to maxsize .
    When accessing via Outlook , this problem does not occur.
    i hope anyone here can help me
    Thanks in advance

    Hi,
    To change the maximum message size for Outlook Web App clients, you need to change the value of
    maxAllowedContentLength, maxRequestLength and both instances of
    maxReceivedMessageSize by editing %ExchangeInstallPath%ClientAccess\Owa\web.config in notepad.
    To change the maximum message size for Exchange Web Services clients, you need to change the value of
    maxAllowedContentLength and all instances of maxReceivedMessageSize="67108864" in %ExchangeInstallPath%ClientAccess\exchweb\ews\web.config.
    When you are finished, save and close the Web.config file. Also need to restart IIS by running the following command:
    IISReset /noforce
    For more information about Configure Client-Specific Message Size Limits on Client Access Servers, please refer to:
    http://technet.microsoft.com/en-us/library/hh529949(v=exchg.150).aspx
    Thanks,
    Winnie Liang
    TechNet Community Support

  • How to send Email with attachments

    Hi im Trying to send a file as attachment using EMail Activity operator.
    Can we do it using Email activity? If yes, then how can we do it? If no, then please tell me about any other method using which i can send a email with attachments.
    Regards
    Vibhuti

    Better late than never, a comprehensive demo on the topic:
    REM
    REM maildemo.sql - A PL/SQL package to demonstrate how to use the UTL_SMTP
    REM package to send emails in ASCII and non-ASCII character sets, emails
    REM with text or binary attachments.
    REM
    REM Note: this package relies on the UTL_ENCODE PL/SQL package in Oracle 9i.
    CREATE OR REPLACE PACKAGE demo_mail IS
      ----------------------- Customizable Section -----------------------
      -- Customize the SMTP host, port and your domain name below.
      smtp_host   VARCHAR2(256) := 'smtp-server.some-company.com';
      smtp_port   PLS_INTEGER   := 25;
      smtp_domain VARCHAR2(256) := 'some-company.com';
      -- Customize the signature that will appear in the email's MIME header.
      -- Useful for versioning.
      MAILER_ID   CONSTANT VARCHAR2(256) := 'Mailer by Oracle UTL_SMTP';
      --------------------- End Customizable Section ---------------------
      -- A unique string that demarcates boundaries of parts in a multi-part email
      -- The string should not appear inside the body of any part of the email.
      -- Customize this if needed or generate this randomly dynamically.
      BOUNDARY        CONSTANT VARCHAR2(256) := '-----7D81B75CCC90D2974F7A1CBD';
      FIRST_BOUNDARY  CONSTANT VARCHAR2(256) := '--' || BOUNDARY || utl_tcp.CRLF;
      LAST_BOUNDARY   CONSTANT VARCHAR2(256) := '--' || BOUNDARY || '--' ||
                                                  utl_tcp.CRLF;
      -- A MIME type that denotes multi-part email (MIME) messages.
      MULTIPART_MIME_TYPE CONSTANT VARCHAR2(256) := 'multipart/mixed; boundary="'||
                                                      BOUNDARY || '"';
      MAX_BASE64_LINE_WIDTH CONSTANT PLS_INTEGER   := 76 / 4 * 3;
      -- A simple email API for sending email in plain text in a single call.
      -- The format of an email address is one of these:
      --   someone@some-domain
      --   "Someone at some domain" <someone@some-domain>
      --   Someone at some domain <someone@some-domain>
      -- The recipients is a list of email addresses  separated by
      -- either a "," or a ";"
      PROCEDURE mail(sender     IN VARCHAR2,
               recipients IN VARCHAR2,
               subject    IN VARCHAR2,
               message    IN VARCHAR2);
      -- Extended email API to send email in HTML or plain text with no size limit.
      -- First, begin the email by begin_mail(). Then, call write_text() repeatedly
      -- to send email in ASCII piece-by-piece. Or, call write_mb_text() to send
      -- email in non-ASCII or multi-byte character set. End the email with
      -- end_mail().
      FUNCTION begin_mail(sender     IN VARCHAR2,
                    recipients IN VARCHAR2,
                    subject    IN VARCHAR2,
                    mime_type  IN VARCHAR2    DEFAULT 'text/plain',
                    priority   IN PLS_INTEGER DEFAULT NULL)
                    RETURN utl_smtp.connection;
      -- Write email body in ASCII
      PROCEDURE write_text(conn    IN OUT NOCOPY utl_smtp.connection,
                     message IN VARCHAR2);
      -- Write email body in non-ASCII (including multi-byte). The email body
      -- will be sent in the database character set.
      PROCEDURE write_mb_text(conn    IN OUT NOCOPY utl_smtp.connection,
                     message IN            VARCHAR2);
      -- Write email body in binary
      PROCEDURE write_raw(conn    IN OUT NOCOPY utl_smtp.connection,
                    message IN RAW);
      -- APIs to send email with attachments. Attachments are sent by sending
      -- emails in "multipart/mixed" MIME format. Specify that MIME format when
      -- beginning an email with begin_mail().
      -- Send a single text attachment.
      PROCEDURE attach_text(conn         IN OUT NOCOPY utl_smtp.connection,
                   data         IN VARCHAR2,
                   mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                   inline       IN BOOLEAN  DEFAULT TRUE,
                   filename     IN VARCHAR2 DEFAULT NULL,
                      last         IN BOOLEAN  DEFAULT FALSE);
      -- Send a binary attachment. The attachment will be encoded in Base-64
      -- encoding format.
      PROCEDURE attach_base64(conn         IN OUT NOCOPY utl_smtp.connection,
                     data         IN RAW,
                     mime_type    IN VARCHAR2 DEFAULT 'application/octet',
                     inline       IN BOOLEAN  DEFAULT TRUE,
                     filename     IN VARCHAR2 DEFAULT NULL,
                     last         IN BOOLEAN  DEFAULT FALSE);
      -- Send an attachment with no size limit. First, begin the attachment
      -- with begin_attachment(). Then, call write_text repeatedly to send
      -- the attachment piece-by-piece. If the attachment is text-based but
      -- in non-ASCII or multi-byte character set, use write_mb_text() instead.
      -- To send binary attachment, the binary content should first be
      -- encoded in Base-64 encoding format using the demo package for 8i,
      -- or the native one in 9i. End the attachment with end_attachment.
      PROCEDURE begin_attachment(conn         IN OUT NOCOPY utl_smtp.connection,
                        mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                        inline       IN BOOLEAN  DEFAULT TRUE,
                        filename     IN VARCHAR2 DEFAULT NULL,
                        transfer_enc IN VARCHAR2 DEFAULT NULL);
      -- End the attachment.
      PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                      last IN BOOLEAN DEFAULT FALSE);
      -- End the email.
      PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection);
      -- Extended email API to send multiple emails in a session for better
      -- performance. First, begin an email session with begin_session.
      -- Then, begin each email with a session by calling begin_mail_in_session
      -- instead of begin_mail. End the email with end_mail_in_session instead
      -- of end_mail. End the email session by end_session.
      FUNCTION begin_session RETURN utl_smtp.connection;
      -- Begin an email in a session.
      PROCEDURE begin_mail_in_session(conn       IN OUT NOCOPY utl_smtp.connection,
                          sender     IN VARCHAR2,
                          recipients IN VARCHAR2,
                          subject    IN VARCHAR2,
                          mime_type  IN VARCHAR2  DEFAULT 'text/plain',
                          priority   IN PLS_INTEGER DEFAULT NULL);
      -- End an email in a session.
      PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection);
      -- End an email session.
      PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection);
    END;
    CREATE OR REPLACE PACKAGE BODY demo_mail IS
      -- Return the next email address in the list of email addresses, separated
      -- by either a "," or a ";".  The format of mailbox may be in one of these:
      --   someone@some-domain
      --   "Someone at some domain" <someone@some-domain>
      --   Someone at some domain <someone@some-domain>
      FUNCTION get_address(addr_list IN OUT VARCHAR2) RETURN VARCHAR2 IS
        addr VARCHAR2(256);
        i    pls_integer;
        FUNCTION lookup_unquoted_char(str  IN VARCHAR2,
                          chrs IN VARCHAR2) RETURN pls_integer AS
          c            VARCHAR2(5);
          i            pls_integer;
          len          pls_integer;
          inside_quote BOOLEAN;
        BEGIN
           inside_quote := false;
           i := 1;
           len := length(str);
           WHILE (i <= len) LOOP
          c := substr(str, i, 1);
          IF (inside_quote) THEN
            IF (c = '"') THEN
              inside_quote := false;
            ELSIF (c = '\') THEN
              i := i + 1; -- Skip the quote character
            END IF;
            GOTO next_char;
          END IF;
          IF (c = '"') THEN
            inside_quote := true;
            GOTO next_char;
          END IF;
          IF (instr(chrs, c) >= 1) THEN
             RETURN i;
          END IF;
          <<next_char>>
          i := i + 1;
           END LOOP;
           RETURN 0;
        END;
      BEGIN
        addr_list := ltrim(addr_list);
        i := lookup_unquoted_char(addr_list, ',;');
        IF (i >= 1) THEN
          addr      := substr(addr_list, 1, i - 1);
          addr_list := substr(addr_list, i + 1);
        ELSE
          addr := addr_list;
          addr_list := '';
        END IF;
        i := lookup_unquoted_char(addr, '<');
        IF (i >= 1) THEN
          addr := substr(addr, i + 1);
          i := instr(addr, '>');
          IF (i >= 1) THEN
         addr := substr(addr, 1, i - 1);
          END IF;
        END IF;
        RETURN addr;
      END;
      -- Write a MIME header
      PROCEDURE write_mime_header(conn  IN OUT NOCOPY utl_smtp.connection,
                         name  IN VARCHAR2,
                         value IN VARCHAR2) IS
      BEGIN
        utl_smtp.write_data(conn, name || ': ' || value || utl_tcp.CRLF);
      END;
      -- Mark a message-part boundary.  Set <last> to TRUE for the last boundary.
      PROCEDURE write_boundary(conn  IN OUT NOCOPY utl_smtp.connection,
                      last  IN            BOOLEAN DEFAULT FALSE) AS
      BEGIN
        IF (last) THEN
          utl_smtp.write_data(conn, LAST_BOUNDARY);
        ELSE
          utl_smtp.write_data(conn, FIRST_BOUNDARY);
        END IF;
      END;
      PROCEDURE mail(sender     IN VARCHAR2,
               recipients IN VARCHAR2,
               subject    IN VARCHAR2,
               message    IN VARCHAR2) IS
        conn utl_smtp.connection;
      BEGIN
        conn := begin_mail(sender, recipients, subject);
        write_text(conn, message);
        end_mail(conn);
      END;
      FUNCTION begin_mail(sender     IN VARCHAR2,
                    recipients IN VARCHAR2,
                    subject    IN VARCHAR2,
                    mime_type  IN VARCHAR2    DEFAULT 'text/plain',
                    priority   IN PLS_INTEGER DEFAULT NULL)
                    RETURN utl_smtp.connection IS
        conn utl_smtp.connection;
      BEGIN
        conn := begin_session;
        begin_mail_in_session(conn, sender, recipients, subject, mime_type,
          priority);
        RETURN conn;
      END;
      PROCEDURE write_text(conn    IN OUT NOCOPY utl_smtp.connection,
                     message IN VARCHAR2) IS
      BEGIN
        utl_smtp.write_data(conn, message);
      END;
      PROCEDURE write_mb_text(conn    IN OUT NOCOPY utl_smtp.connection,
                     message IN            VARCHAR2) IS
      BEGIN
        utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(message));
      END;
      PROCEDURE write_raw(conn    IN OUT NOCOPY utl_smtp.connection,
                    message IN RAW) IS
      BEGIN
        utl_smtp.write_raw_data(conn, message);
      END;
      PROCEDURE attach_text(conn         IN OUT NOCOPY utl_smtp.connection,
                   data         IN VARCHAR2,
                   mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                   inline       IN BOOLEAN  DEFAULT TRUE,
                   filename     IN VARCHAR2 DEFAULT NULL,
                      last         IN BOOLEAN  DEFAULT FALSE) IS
      BEGIN
        begin_attachment(conn, mime_type, inline, filename);
        write_text(conn, data);
        end_attachment(conn, last);
      END;
      PROCEDURE attach_base64(conn         IN OUT NOCOPY utl_smtp.connection,
                     data         IN RAW,
                     mime_type    IN VARCHAR2 DEFAULT 'application/octet',
                     inline       IN BOOLEAN  DEFAULT TRUE,
                     filename     IN VARCHAR2 DEFAULT NULL,
                     last         IN BOOLEAN  DEFAULT FALSE) IS
        i   PLS_INTEGER;
        len PLS_INTEGER;
      BEGIN
        begin_attachment(conn, mime_type, inline, filename, 'base64');
        -- Split the Base64-encoded attachment into multiple lines
        i   := 1;
        len := utl_raw.length(data);
        WHILE (i < len) LOOP
           IF (i + MAX_BASE64_LINE_WIDTH < len) THEN
          utl_smtp.write_raw_data(conn,
             utl_encode.base64_encode(utl_raw.substr(data, i,
             MAX_BASE64_LINE_WIDTH)));
           ELSE
          utl_smtp.write_raw_data(conn,
            utl_encode.base64_encode(utl_raw.substr(data, i)));
           END IF;
           utl_smtp.write_data(conn, utl_tcp.CRLF);
           i := i + MAX_BASE64_LINE_WIDTH;
        END LOOP;
        end_attachment(conn, last);
      END;
      PROCEDURE begin_attachment(conn         IN OUT NOCOPY utl_smtp.connection,
                        mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                        inline       IN BOOLEAN  DEFAULT TRUE,
                        filename     IN VARCHAR2 DEFAULT NULL,
                        transfer_enc IN VARCHAR2 DEFAULT NULL) IS
      BEGIN
        write_boundary(conn);
        write_mime_header(conn, 'Content-Type', mime_type);
        IF (filename IS NOT NULL) THEN
           IF (inline) THEN
           write_mime_header(conn, 'Content-Disposition',
             'inline; filename="'||filename||'"');
           ELSE
           write_mime_header(conn, 'Content-Disposition',
             'attachment; filename="'||filename||'"');
           END IF;
        END IF;
        IF (transfer_enc IS NOT NULL) THEN
          write_mime_header(conn, 'Content-Transfer-Encoding', transfer_enc);
        END IF;
        utl_smtp.write_data(conn, utl_tcp.CRLF);
      END;
      PROCEDURE end_attachment(conn IN OUT NOCOPY utl_smtp.connection,
                      last IN BOOLEAN DEFAULT FALSE) IS
      BEGIN
        utl_smtp.write_data(conn, utl_tcp.CRLF);
        IF (last) THEN
          write_boundary(conn, last);
        END IF;
      END;
      PROCEDURE end_mail(conn IN OUT NOCOPY utl_smtp.connection) IS
      BEGIN
        end_mail_in_session(conn);
        end_session(conn);
      END;
      FUNCTION begin_session RETURN utl_smtp.connection IS
        conn utl_smtp.connection;
      BEGIN
        -- open SMTP connection
        conn := utl_smtp.open_connection(smtp_host, smtp_port);
        utl_smtp.helo(conn, smtp_domain);
        RETURN conn;
      END;
      PROCEDURE begin_mail_in_session(conn       IN OUT NOCOPY utl_smtp.connection,
                          sender     IN VARCHAR2,
                          recipients IN VARCHAR2,
                          subject    IN VARCHAR2,
                          mime_type  IN VARCHAR2  DEFAULT 'text/plain',
                          priority   IN PLS_INTEGER DEFAULT NULL) IS
        my_recipients VARCHAR2(32767) := recipients;
        my_sender     VARCHAR2(32767) := sender;
      BEGIN
        -- Specify sender's address (our server allows bogus address
        -- as long as it is a full email address ([email protected]).
        utl_smtp.mail(conn, get_address(my_sender));
        -- Specify recipient(s) of the email.
        WHILE (my_recipients IS NOT NULL) LOOP
          utl_smtp.rcpt(conn, get_address(my_recipients));
        END LOOP;
        -- Start body of email
        utl_smtp.open_data(conn);
        -- Set "From" MIME header
        write_mime_header(conn, 'From', sender);
        -- Set "To" MIME header
        write_mime_header(conn, 'To', recipients);
        -- Set "Subject" MIME header
        write_mime_header(conn, 'Subject', subject);
        -- Set "Content-Type" MIME header
        write_mime_header(conn, 'Content-Type', mime_type);
        -- Set "X-Mailer" MIME header
        write_mime_header(conn, 'X-Mailer', MAILER_ID);
        -- Set priority:
        --   High      Normal       Low
        --   1     2     3     4     5
        IF (priority IS NOT NULL) THEN
          write_mime_header(conn, 'X-Priority', priority);
        END IF;
        -- Send an empty line to denotes end of MIME headers and
        -- beginning of message body.
        utl_smtp.write_data(conn, utl_tcp.CRLF);
        IF (mime_type LIKE 'multipart/mixed%') THEN
          write_text(conn, 'This is a multi-part message in MIME format.' ||
         utl_tcp.crlf);
        END IF;
      END;
      PROCEDURE end_mail_in_session(conn IN OUT NOCOPY utl_smtp.connection) IS
      BEGIN
        utl_smtp.close_data(conn);
      END;
      PROCEDURE end_session(conn IN OUT NOCOPY utl_smtp.connection) IS
      BEGIN
        utl_smtp.quit(conn);
      END;
    END;
    /

  • Sending emails with attachments through outlook 2003

    Hello,
    I have recently switch from cablevison to Fios. With Cablevison, I never had a problem with email. However, now I am having problems sending emails with attachments using outlook 2003. I have called Verizon and we troubleshooted the problem and they feel this is a Microsoft problem.
    I can send email's without attachments through outlook and verizon.net, but I can't send emails with attachments through outlook, I can send them though verizon.net.  All my settings are correct for sending and receiving email.
    I called Microsoft and they say it a Verizon problem...
    HELP, does anyone have a solution?????
    Thanks
    Len628

    Which antivirus software do you run on your computer? Are there any errors posting?  Have you shut off any email firewalls temporarily to attempt to isolate your issue?  Do you have outlook 2003 on more than 1 pc in your home?  Have your tried to attach a small text file and send it to see if that goes thru successfully?
    Joe D
    Verizon Telecom
    Fiber Solution Center
    Notice: Content posted by Verizon employees is meant to be informational and does not supercede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.Follow us on Twitter™!

  • Outlook 2010 wont send emails with attachments

    Hello
    I was starting to write the question when we found out what the problem was. So I thought I would share our resolution in here, in case someone fall in the same issue.
    One of my user with Outlook 2010 cannot send emails with attachments of some size. +-50 kb files works fine.
    But when we try a file of 1mb, the mail goes in the Outbox, Exchange status swith from Connected to Disconnected and the email stay there.
    The user is in a remote location, connected through VPN with the network where the Exchange 2013 server is
    Here is what I did:
    1. Re-create Outlook profile: wont work
    2. Re-create Windows profile: wont work
    3. Check ip settings: fine
    4. Try in OWA: wont work
    5. Look at Exchange settings for outgoing email size: 10mb
    6. Load my user's Outlook profile on another LAN: works fine
    That last point made me thought about a potential problem on the remote user's lan. So I did
    7. Check VPN config between the remote site and IT site: fine
    After googling the problem, I found that website (http://community.spiceworks.com/topic/396793-outlook-2010-client-suddenly-showing-disconnected-from-2013-exchange-server) that suggest to change the DNS setting on the client. However, the DHCP of my remote
    user was the router itself, which is giving a DC as primary DNS, and ISP DNS as secondary. I changed the secondary DNS for another DC in our organization, and guess what? Voila! Problem is gone!
    Thinking about it that make not much sense, as the primary DNS is always up the secondary shouldn't be queried. But that's what resolved our problem.
    Hope it helps someone!
    Martin

    Hi Martin,
    Thanks for your sharing:)
    If you have any question about Microsoft Office, welcome to contact us and feel free to post your issue on Office forum.
    Regards,
    Winnie Liang
    TechNet Community Support

  • Send emails with attachments residing in the network

    Hi All,
    My requirement is to send email with attachments. I am using javamail and it works fine only if the attachment resides in the local machine.
    If the attachment resides in the network [the folder is shared by the user], the application gives me IOException.
    Please help. Let me know if I am not clear.

    Please find the trace below . Also I am able to browse the share but haven't tried writing a test app.
    javax.mail.MessagingException: IOException while sending message
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:595)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at SendEmail.sendMail(SendEmail.java:66)
    at FetchDetails.fetchResultSet(FetchDetails.java:69)
    at FetchDetails.<init>(FetchDetails.java:36)
    at Index.main(Index.java:3)
    Caused by: java.io.FileNotFoundException: \xxx.xxx.xx.xxx\dinesh\dialog.gif (The
    system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:103)
    at javax.activation.FileDataSource.getInputStream(FileDataSource.java:80
    at javax.activation.DataHandler.writeTo(DataHandler.java:287)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1248)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:747)
    at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:361)
    at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:85
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:83
    9)
    at javax.activation.DataHandler.writeTo(DataHandler.java:295)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1248)
    at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1673)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:555)
    ... 6 more
    Cant send mail. IOException while sending message

  • Cant send emails with attachments

    All of a sudden I cant send emails with attachments from my iphone or iPad.
    Has anyone else had similar issues?
    I have deleted and reset the accounts up and also tried different devices all with the same problem.

    Please find the trace below . Also I am able to browse the share but haven't tried writing a test app.
    javax.mail.MessagingException: IOException while sending message
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:595)
    at javax.mail.Transport.send0(Transport.java:169)
    at javax.mail.Transport.send(Transport.java:98)
    at SendEmail.sendMail(SendEmail.java:66)
    at FetchDetails.fetchResultSet(FetchDetails.java:69)
    at FetchDetails.<init>(FetchDetails.java:36)
    at Index.main(Index.java:3)
    Caused by: java.io.FileNotFoundException: \xxx.xxx.xx.xxx\dinesh\dialog.gif (The
    system cannot find the path specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:103)
    at javax.activation.FileDataSource.getInputStream(FileDataSource.java:80
    at javax.activation.DataHandler.writeTo(DataHandler.java:287)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1248)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:747)
    at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:361)
    at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:85
    at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:83
    9)
    at javax.activation.DataHandler.writeTo(DataHandler.java:295)
    at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1248)
    at javax.mail.internet.MimeMessage.writeTo(MimeMessage.java:1673)
    at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:555)
    ... 6 more
    Cant send mail. IOException while sending message

  • Procedure for Sending Emails with Attachments

    Hi All,
    Q1. We wish to write a PROCEDURE that sends emails with attachments in SQL. Can someone please suggest the procedure code for the same?
    Q2. Apart from DBMS_JOB utlity can any other this procedure be scheduled to send automatic emails picking up files from a remote filer randomly.
    Regards,
    Chinmay

    http://www.lv2000.com/articles/utlsmtp.htm
    I do not understand what the article is trying to say when it says this:
    <quote>
    1. You cannot send a Subject line with your email.
    2. You cannot add attachments to your message.
    Hopefully, these two deficiencies will be rectified in future releases!
    </quote>
    The entire email sending code with attachments is freely available from Oracle (sitting on top of utl_smtp package). No need to buy additional software.

  • Is it possible to send emails with attachments fro...

    Hi there,
    I was wondering whether it's possible to send emails with attachments from a Nokia 5230, it's just I would like to be able to send emails with attachments without using a computer especially when I'm out on my journeys.
    Many thanks,
    Tim Auluck
    Solved!
    Go to Solution.

    Hi RocknRollTim,
    Thanks for your reply. Have you already tried sending these files? Though you're not able to create all these files on the phone itself, you should be able to send them in an attachment when they're on your memory card.
    Uploading a .jpg, .tiff, .gif, .doc, .docx .htm, .html .key, .numbers, .pages, .pdf, .ppt, .pptx, .txt, .rtf, .vcf, .xls or .xlsx file shouldn't be a problem when uploading. Just click on 'Other' when adding an attachment, then on 'Other files' and there you will be able to select any file that you have saved on your memory card.   
    Whether you can actually send the email depends on the strength of your internet connection (as I mentioned in my previous post). Also keep in mind that the phone itself as well as the network work with a maximum size file that you can send over 3G (more information about this can be found here), and can therfore also limit you in sending large files.
    In any case, let me know how you get on so that we can assist further where necessary.
    Iris9290 
    If my post has helped you in any way, please accept it as a solution or click on the white star, so that other users will be able to benefit from it too.

  • Sending mail with excel  more than 255 character in a line

    Dears,
    In my program , I use SO_NEW_DOCUMENT_ATT_SEND_API1  to send email with EXCEL attacment.
    But when i want output a line more than 255 characters  in the excel I met the problem, it only appeared 255 characters
    describe table mailbin lines tab_lines.
        mailpack-transf_bin = c_checked.
        mailpack-head_start = 1.
        mailpack-head_num = 1.
        mailpack-body_start = 1.
        mailpack-body_num = tab_lines.
        mailpack-doc_type = c_xls.
        mailpack-obj_name = space.
        mailpack-obj_descr = lv_mail_title. "the excel file name
        mailpack-doc_size = tab_lines * 255.
        append mailpack.
    * Sending the document
          call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            exporting
              document_data              = maildata
              put_in_outbox              = space
              commit_work                = c_checked
            tables
              packing_list               = mailpack
              object_header              = mailhead
              contents_bin               = mailbin
              contents_txt               = mailtxt
              receivers                  = mailrec
            exceptions
              too_many_receivers         = 1
              document_not_sent          = 2
              operation_no_authorization = 4
              others                     = 99.
    But i have to output those characters in one line.
    Anyone could help me?
    Thanks a lot.
    Sincerely,
    Julie

    data: objpack    like sopcklsti1 occurs 2 with header line.
    data: objhead    like solisti1 occurs 1 with header line.
    data: objbin     like solisti1 occurs 10 with header line,
            is_objbin  type  solisti1 .
    data: objtxt     like solisti1 occurs 10 with header line,
            is_objtxt  type solisti1 .
      data: l_tab(1)   type c value cl_abap_char_utilities=>horizontal_tab,
           con_cret   type c value cl_abap_char_utilities=>cr_lf.
    data: tab_lines  like sy-tabix,
            : tab_lines1 like sy-tabix.
      data : lenth_string type string,
            s_string     type string.
    data : L type i, i type i,cplen type i, balance type i,
    before describe table mailbin lines tab_lines ... Use below logic.
    Loop at your_internaltable.
    concatenate field_1
                field_2
                field_3
           into lenth_string separated by l_tab.
    concatenate  lenth_string con_cret into lenth_string.  
    concatenate s_string lenth_string into s_string.
    endloop.
           L = strlen( s_string ).
           i = 0.
           cplen = 255.
           balance = l.
        do.
          if balance <= 0.
            exit.
          endif.
          if balance < 255.
            cplen = balance.
          else.
            cplen = 255.
          endif.
          objbin = s_string+i(cplen).
          i = i + cplen.
          balance = balance - cplen.
          append objbin.
        enddo. 
    ...... after this use ur exesting code....describe table mailbin lines tab_lines and so
        describe table objbin lines tab_lines1.
        clear objpack-transf_bin.
        objpack-transf_bin = ' '.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines1.
        objpack-obj_langu = 'E'.
        objpack-doc_type = 'XLS'.
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        exporting
    -tables
          packing_list               = objpack
          object_header              = objhead
          contents_bin               = objbin
          receivers                  = reclist
    Regards,
    Sri.
    Edited by: sridhar arjunan on Jul 28, 2009 4:22 PM
    Edited by: sridhar arjunan on Jul 28, 2009 4:23 PM

Maybe you are looking for