Submit by Email with CC for a pdf as an attachment

Hello,
I am using the codes below for a regular submit button to submit by email and having a problem of CC address. I hard-coded the CC address but it does not seem to recognize it, it keep taking the address in the "To" to put on the CC address. Can any one please check for me if there is any wrong with the codes below on the mouse up event:
var cToAddr = "[email protected]";
var cCCAddr = "[email protected]";
//Set the subject and body text for the e-mail message
var cSubLine = "Craft Issue Tracking Form";
var cBody = "Please see the attached form.";
// Send the form data as an FDF attachment on an e-mail
event.target.mailDoc({bUI: true, cTo: cToAddr, cCc: cCCAddr, cSubject: cSubLine, cMsg: cBody});
Thanks in advance,
Han Dao

Try this..
If you are using a regular Button then place the below code in the click event of the button.
event.target.submitForm({cURL:"mailto:"+ cToAddr + "?cc=" + cCCAddr + "&subject=" + cSubLine + "&body=" + cBody,cSubmitAs:"PDF"});
Thanks
Srini
var cToAddr = "[email protected]";
var cCCAddr = "[email protected]";
//Set the subject and body text for the e-mail message
var cSubLine = "Craft Issue Tracking Form";
var cBody = "Please see the attached form.";
// Send the form data as an FDF attachment on an e-mail

Similar Messages

  • When I am in Safari and have an email with a WORD or PDF or Other attachment, how do I set it up so the document opens in WORD, etc. rather than going into download?

    When I am in a Safari email and it has an attachment (WORD, EXCEL, PDF) and I click on the attachment to open it, it goes to download.
    How can I get the document to open directly into WORD, etc.   I am able to do this when I use Chrome and email.

    I see that mail.app works.    The Preferences > General > Open safe files after downloading  did not help.
    I have no problem opening documents directly with Firefox and Chrome, and was looking for a comparable solution with Safari.

  • How to submit an email with a header/footer in the body of the email?

    I'm trying to submit an email with a PDF attachment but needs to have a static header and footer in the the body of the email before sending it.  How would this be done and is it possible to do this? I'm new at this and not sure how to even start this.  Any help with this is greatly appreciated.  Thank you.

    You can put info into the body of the email but you are limited on formatting it. Here is a post from Stefan Cameron with sample that I think will really help you.
    http://forms.stefcameron.com/2008/08/28/submitting-form-data-by-email/

  • Send Email with Webdynpro for Abap

    Hi,
    i want to send an email without a attachment after the customer has filled a form.
    The Webdynpro for Abap action must send a notification Email to the
    service department about these new request.
    Has anyone an example how to send an email with Webdynpro for Abap.
    Thanks
    Thomas

    Hi Micky,
    thanks for your help. I trying to used the SO_NEW_DOCUMENT_SEND_API1 in
    a action of my webdynpro for Abap. But I getting the error message that a structure parameter responce an error.
    Here the Code of the Action:
    DATA HEADER TYPE TABLE OF STRING.
    DATA RECEIVERS TYPE STRING.
    RECEIVERS = 'my-mailadress'.
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
        DOCUMENT_DATA          = 'nothing'.
      DOCUMENT_TYPE          = 'RAW'
      PUT_IN_OUTBOX             = ' '
      COMMIT_WORK              = ' '
    IMPORTING
      SENT_TO_ALL                 =
      NEW_OBJECT_ID            =
      TABLES
        OBJECT_HEADER           = HEADER.
      OBJECT_CONTENT         =
      CONTENTS_HEX             =
      OBJECT_PARA               =
      OBJECT_PARB               =
        RECEIVERS                    = RECEIVERS.
    EXCEPTIONS
      TOO_MANY_RECEIVERS                     = 1
      DOCUMENT_NOT_SENT                       = 2
      DOCUMENT_TYPE_NOT_EXIST            = 3
      OPERATION_NO_AUTHORIZATION       = 4
      PARAMETER_ERROR                          = 5
      X_ERROR                                            = 6
      ENQUEUE_ERROR                              = 7
      OTHERS                                              = 8
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    What's wrong ?
    Thanks for your help.
    Thomas

  • Submit by email with Mac OS

    Hi there,
    First time posting.  Thanks to everyone who is so amazing at answering questions here. I've learned alot.
    I have a form created with Live Cycle Designer ES4.  I have enabled reader rights by doing "Save as other" in Acrobat Pro.
    The "Submit by Email" function is setup to send the "complete PDF" as an attachment.  It works GREAT on a PC - perfect actually!  I get that popup box asking if I want to use my 'default email application' or 'webmail'.
    On a MAC however, that same button does nothing when pressed.  I have made sure I am using the latest version of Adobe Reader on the mac and that I am not viewing the form through preview or any other app.
    Does anyone have any advice as to how I can get this working on a MAC?
    Thanks so much in advance!

    It’s a wonder you could understand what I meant and glad you got it figured out here is an improved version of what I tried to say: (May help others struggling with same issue.
    Sorry No advice. You can't, because Adobe it its shortsightedness hasn't built in XML based PDF support into the Mac Version. And probably never will. Adobe after 20-25 years still considers Macs as toys not really meant for serious work. Despite the fact, were it not for Mac users, And Adobe writing products for Mac first, they would still amount to a Font House today. For two years or more they wrote exclusively for Mac until PC's accepted them, after Mac Users worked the bugs out. Then we were all but abandoned.
    We can read XML based PDF's, but can do nothing with them . What we can do, is re-save them which converts them to Plain PDF's. Then go to Forms Manager, and setup the form which will work on all Platforms.
    So what you need to do is if you want your audience to include Mac users as well is avoid Lifecycle created forms and don't use any XML Based PDF Form . Create regular PDF forms and will it work on any platform.

  • Sending email with 2 attachments in PDF Format

    Hi,
    I have 2 ALV Layouts, totally different in Structure.
    Now I need to convert these 2 ALV layout to 2 different PDF files and send email with thses 2 attachments.
    Can anyone provide me with sample report.
    I tried searching  for it  but there is no clue for ALV report-> PDF -> email.
    Thanks
    Mohan

    Hello,
    I doubt if you really searched before posting. You will find many posts indicating how to convert your report output be it ALV or classical into spool and then in to pdf. After you get the pdf binary format, its pretty much the same attaching those and sending E-mail
    Vikranth

  • How to print an email with link on a pdf output

    Hi,
    I have requirement to print an email with link like mailto: ...at...com
    I created a hyper link in my text element which created a <%W> ... </> tag. this message in this text element will be sent as a body of an email. I want to know to do the link like I mentioned above. Please let me know this is not clear.
    Thanks,
    Surya.

    Srinivas, Thanks for your quick reply.
    This is smartform, and sending the output as pdf, except the the first page on which I have the text to be printed on the email body. In this email body text I have to display an email.
    when user clicks on the email should open an outlook with the email id in the TO. Hope this helps.
    Thank you,
    Surya

  • Install 3rd party PDF iFilter for index PDF file as attachment in e-mail (msg)

    I have called Microsoft Permium Support, base on the reply, SharePoint 2013 does not support to index a PDF file attachment in E-mail (msg) except 3rd party iFilter installed. And they finally told me how to edit Windows Registry for install the Adobe iFilter.
    But, the Adobe iFilter is too weak to call large PDF files. So, I would like to install and try the Foxit PDF iFilter, but I cannot find an installation guide for this 3rd party ifilter with SharePoint 2013. 
    Does anyone here have the experience for Foxit PDF iFilter with SharePoint 2013 can help me?
    I am not sure it is bug or feature in SharePoint 2013, but in case I still have to install 3rd party iFilter for index PDF file. I have no idea what is the out of box pdf file indexing support for.

    You ca plan to use Foxit. 
    steps are nearly the same which we use in sharepoint 2013
    1. We need to update registry for pdf . Registry value is {987f8d1a-26e6-4554-b007-6b20e2680632}
    2. we need to install the foxit ifilter
    Here are steps for same
    http://support.microsoft.com/kb/2293357
    3. run below command:
    net stop spsearch4
    net start spsearch4
    net stop osearch14
    net start osearch14
    Check below:
    http://bjarnegram.wordpress.com/2011/07/13/installing-foxit-pdf-ifilter-on-sharepoint-server-2010/

  • Acrobat 9Pro - How to add a submit (to email address) button for an online fillable PDF form.

    Sorry if this has been answered before, but this is my first time trying to add a submit button to the bottom of a online fillable pdf form. I have 5 of these froms to do. I need the user to go to my website, click the link to open an online fillable form, fill it out and click a submit button in the form, so it can be emailed to an individual. I thought I followed all the steps correctly in Adobe Acrobat 9 Pro, every which way I could find, but the form gives me an error "this operation not permitted", it's in IE, created in Vista and I now have a headache. Do I need to add extra code to my website html somewhere?
    Does anyone have the neccessary steps to make this work, a video would be even better. Do I have to have this LifeCycle Designer thing?
    My url in case anyone wants to see it. http://www.dyenetwebdesign.com/DaysGoneBy/forms/index2.html
    Thanks sooo much!!
    Deb Dye

    Some comments based on your application:
    1. It looks like might likely exceed the 500 use limit, in that case to not use Reader Rights or you will violate the license. The cost beyond that can be negotiated with Adobe (if they will talk to you), but don't expect it to be check. In that case, submit the form data as and FDF file. This file can be imported into the form at your end and get exactly the same results as if the whole form had been sent. The FDF submission does not require Reader Rights. The parent will still be able to print the form, but saving would require having Acrobat, not Reader.
    2. A lot of the data appears to be personal in terms of the name of children, addresses, etc. It would be a good idea to check with legal counsel about submitting such information by e-mail, particularly for children. E-mail is not generally considered secure, unless you possibly used some form of secure e-mail. For that reason you should consider submitting the data to a web script that would be stored someplace for you to obtain it and possibly send you a notice of receipt. A secure website is preferred for this use. You should keep the option open for anyone to submit the form in paper if they object to the potential security risks with your online submission method.
    I know those put rinkles in your forms, but for such an application it is a good idea to consider the potential consequences if you do not worry about the form security and number of uses. The potential is to put you out of business or more. OK, an extremist view, but worth considering.

  • Offline Interactive PDF Forms Using EMail with WebDynpro for ABAP

    These is a tutorial on implementing Offline Interactive PDF Forms using Email to both send out and receive the form back using WebDynpro for Java.
    Is it possible to implement the same using WebDynpro for ABAP, specifically receiving the forms via email server.
    Regards,
    Mark

    Hi Mark,
    Check this out :
    https://www.sdn.sap.com/irj/sdn/interactiveforms-elearning
    Go to section :
    Send, Receive, and Process Interactive Forms via Email in SAP NetWeaver Application Server ABAP (RIG session 4A)
    and for the ABAP WebDynpro :
    SAP Interactive Forms by Adobe in Web Dynpro for ABAP (Session 3A) .
    I managed to make it work in my internal sytem.
    Goodluck.
    Cheers,
    Danny

  • ICWC document emailed with no extension or PDF corrupted.

    CRM 5.0 SP11.
    1. We access a document in the inbox and an attached document exist & agent has visbility to the document in the Document Search (order ack, invoice) saved in CMS as OTF files.
    2. Agent can click the hyper link and see the document (Good)
    3. Agent can select the document and email, in the ICWC email screen agent can click the attachment and again see the document. (Good)
    4. The person receiving the email receives the attachment but their is no extension (.PDF, OTF, etc).  By double clicking on the extension windows ask which program to use and adobe 7.0 reader does open the form but the user has to repeat this action for every email received with an attachment.
    We wrote an enhancement to add the .PDF to the email and step #3 works fine to the ICWC user But the receiving email recipient gets the PDF file but when opening the email the PDF is corrupt
    " Adobe reader could not open .... is not a supported file type or is corrupted, was sent as email attachment and not properly decoded"
    I'm posting here but not sure if this is a SAPconnect issue? Hoping someone else has encountered this. Will give points.

    SAP provided a correction to
    class: CL_CRM_EMAIL_UTILITY_BASE
    method: GET_BODY_PART_FROM_EDITOR

  • Submit by Email AS a PDF (urgent - time crunch)

    I'm creating a form to be distributed externally to clients via email.  I'd like them to be able to fill in the form, then click Submit by Email and have a completed PDF sent back to me (which we save in clients files for our records in an attempt at paperlessness).  I've got the Submit by Email button in my form now, but apparently the default submission format is XML not PDF.  Is there a way to change this?
    Thanks - Sat

    Paul,
    Appreciating your explanations.
    I never knew that we could submit our form in these many ways.
    Your examples are informative and very useful to me.
    I have another question: Can we close the pdf after submitting the form to an email address??
    I mean, a user fills-in a User Acceptance Form and clicking on submit button. This should trigger an email (internally) and the form should close.
    Is it possible?
    Thanks,
    Nith

  • Send email with attachment PDF

    Hi,
    i have two environments. One is updated with support package 16 and the other environment isn't updated.
    in the environment that is not updated i can send normally email with attachment using smartforms with the function 'SO_NEW_DOCUMENT_ATT_SEND_API1' but now i copied this program to the environment that is updated but the attachment have issue...it don't open.
    anybody have some idea to solution?
    tks
    Patricia

    Hi,
    Check the program 'BCS_EXAMPLE_6' for sending PDF as an attachment. Try sending your PDF using the method specified.
    Regards,
    Sagar

  • Edit invoice smartform to email with pdf attachment

    Hi,
    I need to send the invoice details by mail that are currently only printed through the edit function.
    When i go to VF02 enter invoice number and then edit, is it possible to send this message through email with the invoice as pdf attachment?
    Also it would be necessary to enter receivers email at that time.
    Maybe there is an exit before the sending that could raise a popup...
    Do you think this can be done this way?
    Thanks,
    Laurent.

    Hi Laurent
    I have done this succesfully in a different way:
    1) Create a Z Table for the email ID per Bill to party  - this table accomodates up to 999 email ids per customer and also has a column for CC
    2) Create a new output type for EMAIL purposes with the Transmission medium as 1 -
    assign the output program and form to this.
    In the program, add new code to refer to the new Z table for getting the email ids of respective Bill to parties
    In the program add code to convert the form to PDF format and attach to the email craeted.
    Your ABAPPER should be able to assist in this code writing - in my case it took some time to get the desired result but the customers are very happy with the end result -
    best wishes
    Nandu

  • HOW TO SEND A HEBREW EMAIL WITH ATTACHMENT USING DEMO_MAIL

    Hello All,
    This is Not a question , just attaching something I've implemented and might be interesting for few of us,
    This package I'm attaching allows to send Hebrew Language email + attaching files to it.
    This package is based on demo_mail package (combined here but you can search at google for more example information if needed).
    My Package is supplied as is , for any specific information regarding it , please contact me directly at : [email protected] or POST here.
    * Please also note , that this package allow file to be attach via URL (meaning you will have to define a link to this file, if you would like to implement a link to a local file , e.g : c:\temp\myfile , you will have to customize the package your self with database directories option etc ...)
    First I will attach an example of how to use it :
    ==================================
    begin
    demo_mail_heb.send_html_mail_attach(p_sender => '[email protected]',
    p_recipients => '[email protected]',
    p_subject => 'שלום וברכה עולם',
    p_data => '<hr><b>בוקר טוב</b><hr>',
    p_file_name => 'but_choose_file.gif',
    p_file_mime_type => 'application/pdf',
    p_file_URL => 'http://10.172.246.160:7777/i/but_choose_file.gif');
    end;
    Second Here is the Package (please note you will have to modify few settings in order to enable it , such as mail server address ..etc)
    ======================================================================================
    CREATE OR REPLACE PACKAGE demo_mail_heb IS
    ----------------------- Customizable Section -----------------------
    -- Customize the SMTP host, port and your domain name below.
    smtp_host VARCHAR2(256) := 'mail.oracle.com';
    smtp_port PLS_INTEGER := 25;
    smtp_domain VARCHAR2(256) := 'oracle.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;
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255');
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default demo_mail_heb.MULTIPART_MIME_TYPE,
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif');
    -- 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; charset=windows-1255',
              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_heb IS
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255')
    Is
    conn utl_smtp.connection;
    BEGIN
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => p_mime_type);
    demo_mail_heb.write_text(
    conn => conn,
    message => p_data);
    demo_mail_heb.end_mail( conn => conn );
    END;
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default demo_mail_heb.MULTIPART_MIME_TYPE,
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif')
    is
    conn utl_smtp.connection;
    req utl_http.req;
    resp utl_http.resp;
    data RAW(200);
    begin
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => p_mime_type);
    demo_mail_heb.attach_text(
    conn => conn,
    data => p_data,
    mime_type => 'text/html');
    demo_mail_heb.begin_attachment(
    conn => conn,
    mime_type => p_file_mime_type,
    inline => TRUE,
    filename => p_file_name,
    transfer_enc => 'base64');
    -- In writing Base-64 encoded text following the MIME format below,
    -- the MIME format requires that a long piece of data must be splitted
    -- into multiple lines and each line of encoded data cannot exceed
    -- 80 characters, including the new-line characters. Also, when
    -- splitting the original data into pieces, the length of each chunk
    -- of data before encoding must be a multiple of 3, except for the
    -- last chunk. The constant demo_mail_heb.MAX_BASE64_LINE_WIDTH
    -- (76 / 4 * 3 = 57) is the maximum length (in bytes) of each chunk
    -- of data before encoding.
    Utl_Http.set_proxy('www-proxy.us.oracle.com', 'oracle.com');
    req := utl_http.begin_request(p_file_URL);
    resp := utl_http.get_response(req);
    BEGIN
    LOOP
    utl_http.read_raw(resp, data, demo_mail_heb.MAX_BASE64_LINE_WIDTH);
    demo_mail_heb.write_raw(
    conn => conn,
    message => utl_encode.base64_encode(data));
    END LOOP;
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;
    demo_mail_heb.end_attachment( conn => conn );
    demo_mail_heb.end_mail( conn => conn );
    end;
    -- 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);
    utl_smtp.write_raw_data(conn, UTL_RAW.CAST_TO_RAW(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_raw_data(conn, utl_raw.cast_to_raw(CONVERT(message,'IW8ISO8859P8')));
    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',
                   --     mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=windows-1255',
                        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;

    Hello All,
    Small modification - use this package and not the above
    HERE IS A WORKING CODE FOR SENDING HEBREW MESSAGES (INCLUDING SUBJECT IN UTF-8 APPEAR IN ALL EMAIL CLIENTS I HAVE CHECKED) + ATTACHMENTS
    Code attached below is supplied as is with no support. anyhow if help is needed , please contact me via [email protected]
    ============================================================================
    CREATE OR REPLACE PACKAGE demo_mail_heb IS
    ----------------------- Customizable Section -----------------------
    -- Customize the SMTP host, port and your domain name below.
    smtp_host VARCHAR2(256) := pst_ajax.getParameter('EMAIL_SMTP_HOST');
    smtp_port PLS_INTEGER := pst_ajax.getParameter('EMAIL_SMTP_PORT');
    smtp_domain VARCHAR2(256) := pst_ajax.getParameter('EMAIL_SMTP_DOMAIN');
    -- 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;
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255');
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default 'text/html; charset=windows-1255',
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif');
    -- 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;
    -- Handling the Email Subject Line
    function mimeheader_encode(
    p_str varchar2
    , p_charset varchar2 := 'UTF-8') return varchar2;
    -- 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; charset=windows-1255',
              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_heb IS
    -- Sent clear Html Email
    procedure send_html_mail (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default null,
    p_mime_type in varchar2 default 'text/html; charset=windows-1255')
    Is
    conn utl_smtp.connection;
    BEGIN
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => 'text/html; charset=UTF-8');--p_mime_type);
    demo_mail_heb.write_text(
    conn => conn,
    message => p_data);
    demo_mail_heb.end_mail( conn => conn );
    END;
    -- Sent Html Email with Attachment
    procedure send_html_mail_attach (p_sender in varchar2 default null,
    p_recipients in varchar2 default null,
    p_subject in varchar2 default null,
    p_data in varchar2 default '<b>áå÷ø èåá òåìí - áãé÷ä</b',
    p_mime_type in varchar2 default 'text/html; charset=windows-1255',
    p_file_name in varchar2 default 'but_choose_file.gif',
    p_file_mime_type in varchar2 default 'application/pdf',
    p_file_URL in varchar2 default 'http://10.172.246.160:7777/i/but_choose_file.gif')
    is
    conn utl_smtp.connection;
    req utl_http.req;
    resp utl_http.resp;
    data RAW(200);
    v_mime_type varchar2(32767):=demo_mail.MULTIPART_MIME_TYPE;
    begin
    conn := demo_mail_heb.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => v_mime_type);
    demo_mail_heb.attach_text(
    conn => conn,
    data => p_data,
    mime_type => 'text/html');
    demo_mail_heb.begin_attachment(
    conn => conn,
    mime_type => p_file_mime_type,
    inline => TRUE,
    filename => p_file_name,
    transfer_enc => 'base64');
    -- In writing Base-64 encoded text following the MIME format below,
    -- the MIME format requires that a long piece of data must be splitted
    -- into multiple lines and each line of encoded data cannot exceed
    -- 80 characters, including the new-line characters. Also, when
    -- splitting the original data into pieces, the length of each chunk
    -- of data before encoding must be a multiple of 3, except for the
    -- last chunk. The constant demo_mail_heb.MAX_BASE64_LINE_WIDTH
    -- (76 / 4 * 3 = 57) is the maximum length (in bytes) of each chunk
    -- of data before encoding.
    req := utl_http.begin_request(p_file_URL);
    resp := utl_http.get_response(req);
    BEGIN
    LOOP
    utl_http.read_raw(resp, data, demo_mail_heb.MAX_BASE64_LINE_WIDTH);
    demo_mail_heb.write_raw(
    conn => conn,
    message => utl_encode.base64_encode(data));
    END LOOP;
    EXCEPTION
    WHEN utl_http.end_of_body THEN
    utl_http.end_response(resp);
    END;
    demo_mail_heb.end_attachment( conn => conn );
    demo_mail_heb.end_mail( conn => conn );
    end;
    -- 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);
    utl_smtp.write_raw_data(conn, UTL_RAW.CAST_TO_RAW(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_raw_data(conn, utl_raw.cast_to_raw(CONVERT(message,'IW8ISO8859P8')));
    -- utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(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;
    -- Handling the Email Subject Line
    function mimeheader_encode(
    p_str varchar2
    , p_charset varchar2 := 'UTF-8') return varchar2 is
    l_str varchar2(2000);
    begin
    l_str:=utl_raw.cast_to_varchar2(utl_encode.quoted_printable_encode(utl_raw.cast_to_raw(p_str)));
    l_str:=replace(l_str,'='||chr(13)||chr(10),''); --unfold the data
    l_str:=replace(l_str,'?','=3f'); --quote question marks
    l_str:=replace(l_str,' ','=20'); --quote spaces
    l_str:='=?'||p_charset||'?Q?'||l_str||'?='; -- add prefix and suffix
    return l_str;
    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',
    -- mime_type IN VARCHAR2 DEFAULT 'text/plain; charset=windows-1255',
    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 "Content-Type" MIME header
    write_mime_header(conn, 'Content-Type', mime_type);
    -- write_mime_header(conn, 'Content-Type', 'text/html; charset=UTF-8');
    -- Set "Subject" MIME header
    -- write_mime_header(conn, 'Subject', subject);
    -- write_mime_header(conn, 'Subject', CONVERT(subject,'IW8ISO8859P8'));
    write_mime_header(conn, 'Subject',mimeheader_encode(p_str => subject,p_charset => 'UTF-8'));
    -- write_mime_header(conn, 'Subject',CONVERT(subject,'IW8MSWIN1255'));
    -- 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;

Maybe you are looking for

  • Performance with Nested Views

    Hello everyone, we are having a performance problem with oracle optimizing nested views. Some with outer joins. One of the guys just sent me the following statement and I'm wondering if anyone can tell me if it sounds correct. The query is about 300

  • How to put variables in WAD

    Gurus, I'm new to WAD. Please could you guide me how to have variables in WAD (for planning). Right now When I launch the WAD it pops up for all the variables. But what I want is that it should not ask for any variable while launching the WAD and lat

  • Controller skin for SWF video in dreamweaver CS3?

    Hi there, I have inserted a SWF video into my website, however right now it's playing automatically and i have no way of stopping and pausing my video... how can I add a skin controller to my SWF file? I know I can do it with FLVs, but I dunno how to

  • Problem about ExtensionFileFilter

    whats wrong with my code? please have a look at it. import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.util.zip.*; import javax.swing.*; import javax.swing.filechooser.FileFilter; public class ZipTest {     

  • DNG Converter 7.1 won't open!

    Can't open newly installed DNG Converter 7.1 on Tiger 10.4.11 MacPro,  PS11.0.2,  LR2.7.  Adobe's  DNG Converter 7.1 download page states that 7.1 is compatible with OS10.4. Works fine on MacBookPro running 10.5.8.  Any ideas?