How to send an HTML email?

Hey guys
For the longest time I've been wanting to send HTML emails with Mail, not for promotional stuff, but more for thanking our clients for their business. This is the perfect holiday season to send a Thank You email to them, but I don't want just to send a plain and boring text email, I want graphics on it. I know this wasn't possible to do with any previous OSX until Tiger. This is what the Mail page says... - HTML Message Composition - Mail uses the Safari engine to format newly composed email using HTML. I read another post about an HTML Script to work with mail but it got so confusing that I wasn't able to make it work. Can anybody tell how to make this work? A step-by-step tutorial would be great, not just for me but for all those Mail users that are trying to do the same thing. If Apple can send those HTML emails and Newsletters, why can't we? I don't think they're using a Windows computer or any other email software to do this. Better not! :P
This is the post I read, but it was posted a year ago, so I know there's got to be something more up to date.
http://discussions.apple.com/message.jspa?messageID=667497&ft=y&#667497
Thanks a lot in advance!

Hello Luis.
Although RTF with Tiger Mail is basic HTML, you can't compose complex HTML within the body of a message.
You can use an HTML composer of choice to include embedded images/graphics and/or objects that are stored on a server (to be downloaded/rendered from the server) when the message is opened by recipients instead of attaching images/graphics to the message.
After saving the document, you can open the document with Safari to ensure the layout and settings are correct and at the menu bar, choose Edit > Mail Contents of This Page.
A new Mail.app message will open and the contents of the webpage will be copied to the message and it will be sent in its entirety.

Similar Messages

  • How do i send a html email from office outlook web access?

    how do i send a html email from office outlook web access?

        glenholmes,
    You've come to the right place for help. Sorry to hear that you have had hard time with your Gmail app lately. What steps have you tried to get this to work? We want to ensure that you are able to start sending those messages right away.
    ErinW_VZW
    Follow us on Twitter @VZWSupport

  • Sending Unicode HTML email from Oracle

    Dear All,
    How we can send the HTML email from Oracle in Unicode format (I am using Arabic Language, to be specific). So far I have tried the following solutions (using utl_smpt) without any success (either i see junk characters in the email or see question marks). Would you please help me in solving this?
    Options Tried*
    Option 1
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PROCEDURE p_send_mail_test (
      2  sender IN VARCHAR2,
      3  recipient IN VARCHAR2,
      4  subj IN VARCHAR2,
      5  message IN VARCHAR2)
      6  IS
      7  mailhost VARCHAR2(30) := '<smtp Server>';
      8  c utl_smtp.connection;
      9  PROCEDURE send_header( name IN VARCHAR2, header IN VARCHAR2) AS
    10  BEGIN
    11  utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);
    12  END;
    13  BEGIN
    14  c := utl_smtp.open_connection(mailhost,25);
    15  utl_smtp.helo(c, mailhost);
    16  utl_smtp.mail(c, sender);
    17  utl_smtp.rcpt(c, recipient);
    18  utl_smtp.open_data(c);
    19  send_header('From', sender);
    20  send_header('To', recipient);
    21  -- If you need to send mail to more than one receipient, uncomment the
    22  -- following line(s) as appropriate. Please don't forget the ","
    23  -- in the "To" line before the next receipient's email id. You can't
    24  -- use a comma separated list in the receipient parameter.
    25  -- For variable number of "To"'s and "Cc"'s have multiple calls to
    26  -- "send_header" function inside a cursor for loop.
    27  -- Similar comments apply for "Cc" too.
    28  -- send_header('To', ',<email@domain>');
    29   send_header('Cc', ',<email@domain>');
    30  send_header('Subject', subj);
    31  utl_smtp.write_data(c, utl_tcp.CRLF || message);
    32  utl_smtp.close_data(c);
    33  utl_smtp.quit(c);
    34  EXCEPTION
    35  WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
    36  utl_smtp.quit(c);
    37  raise_application_error(-20000,
    38  'Failed to send mail due to the following error: ' || sqlerrm);
    39* END;
    SQL>
    SQL> /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   email_text varchar2(2000);
      3   contract_end_date_v date := sysdate;
      4   name_v varchar2(200) := 'Riaz';
      5   begin
      6    email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||'  المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى  <br/>.ولكم جزيل الشكر والتقدير  </font></div>';
      7    p_send_mail_test('<email@domain>','<email@domain>','Hello',email_text);
      8*  end;
    SQL> /
    PL/SQL procedure successfully completed.
    Result_
    <div align="right"><font size="4"><b>????? Riaz ???????</b>
    ???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
    .???? ???? ????? ???????? </font></div>
    [Question marks along with all tags; this OTN page is converting that to HTML output]
    Option2
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure html_email(
      2      p_to            in varchar2,
      3      p_from          in varchar2,
      4      p_subject       in varchar2,
      5      p_text          in varchar2 default null,
      6      p_html          in varchar2 default null
      7  )
      8  is
      9      l_boundary      varchar2(255) default 'a1b2c3d4e3f2g1';
    10      l_connection    utl_smtp.connection;
    11      l_body_html     clob := empty_clob;  --This LOB will be the email message
    12      l_offset        number;
    13      l_ammount       number;
    14      l_temp          varchar2(32767) default null;
    15      l_smtp_hostname varchar2(50) := '<smtp Server>';
    16  begin
    17      l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
    18      utl_smtp.helo( l_connection, l_smtp_hostname );
    19      utl_smtp.mail( l_connection, p_from );
    20      utl_smtp.rcpt( l_connection, p_to );
    21      l_temp := l_temp || 'MIME-Version: 1.0' ||  chr(13) || chr(10);
    22      l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
    23      l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
    24      l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
    25      l_temp := l_temp || 'Reply-To: ' || p_from ||  chr(13) || chr(10);
    26      l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
    27                           chr(34) || l_boundary ||  chr(34) || chr(13) ||
    28                           chr(10);
    29      ----------------------------------------------------
    30      -- Write the headers
    31      dbms_lob.createtemporary( l_body_html, false, 10 );
    32      dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
    33      ----------------------------------------------------
    34      -- Write the text boundary
    35      l_offset := dbms_lob.getlength(l_body_html) + 1;
    36      l_temp   := '--' || l_boundary || chr(13)||chr(10);
    37      l_temp   := l_temp || 'content-type: text/plain;charset=utf-8' ||
    38                    chr(13) || chr(10) || chr(13) || chr(10);
    39      dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    40      ----------------------------------------------------
    41      -- Write the plain text portion of the email
    42      l_offset := dbms_lob.getlength(l_body_html) + 1;
    43      dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
    44      ----------------------------------------------------
    45      -- Write the HTML boundary
    46      l_temp   := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
    47                      chr(13) || chr(10);
    48      l_temp   := l_temp || 'content-type: text/html;charset=utf-8' ||
    49                     chr(13) || chr(10) || chr(13) || chr(10);
    50      l_offset := dbms_lob.getlength(l_body_html) + 1;
    51      dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    52      ----------------------------------------------------
    53      -- Write the HTML portion of the message
    54      l_offset := dbms_lob.getlength(l_body_html) + 1;
    55      dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
    56      ----------------------------------------------------
    57      -- Write the final html boundary
    58      l_temp   := chr(13) || chr(10) || '--' ||  l_boundary || '--' || chr(13);
    59      l_offset := dbms_lob.getlength(l_body_html) + 1;
    60      dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    61      ----------------------------------------------------
    62      -- Send the email in 1900 byte chunks to UTL_SMTP
    63      l_offset  := 1;
    64      l_ammount := 1900;
    65      utl_smtp.open_data(l_connection);
    66      while l_offset < dbms_lob.getlength(l_body_html) loop
    67          utl_smtp.write_data(l_connection,
    68                              dbms_lob.substr(l_body_html,l_ammount,l_offset));
    69          l_offset  := l_offset + l_ammount ;
    70          l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
    71      end loop;
    72      utl_smtp.close_data(l_connection);
    73      utl_smtp.quit( l_connection );
    74      dbms_lob.freetemporary(l_body_html);
    75* end;
    SQL> /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   email_text varchar2(2000);
      3   contract_end_date_v date := sysdate;
      4   name_v varchar2(200) := 'Riaz';
      5   begin
      6    email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||'  المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى  <br/>.ولكم جزيل الشكر والتقدير  </font></div>';
      7    html_email(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
      8*  end;
    SQL> /
    PL/SQL procedure successfully completed.
    Result*
    ????? Riaz ???????
    ???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
    Option3
    SQL> ed
    Wrote file afiedt.buf
      1  create or replace procedure p_html_email_riaz(
      2      p_to            in varchar2,
      3      p_from          in varchar2,
      4      p_subject       in varchar2,
      5      p_text          in varchar2 default null,
      6      p_html          in varchar2 default null
      7  )
      8  is
      9      l_boundary      varchar2(255) default 'a1b2c3d4e3f2g1';
    10      l_connection    utl_smtp.connection;
    11      l_body_html     clob := empty_clob;  --This LOB will be the email message
    12      l_offset        number;
    13      l_ammount       number;
    14      l_temp          varchar2(32767) default null;
    15      l_smtp_hostname varchar2(50) := '<smtp Server>';
    16  begin
    17      l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
    18      utl_smtp.helo( l_connection, l_smtp_hostname );
    19      utl_smtp.mail( l_connection, p_from );
    20      utl_smtp.rcpt( l_connection, p_to );
    21      l_temp := l_temp || 'MIME-Version: 1.0' ||  chr(13) || chr(10);
    22      l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
    23      l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
    24      l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
    25      l_temp := l_temp || 'Reply-To: ' || p_from ||  chr(13) || chr(10);
    26      l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
    27                           chr(34) || l_boundary ||  chr(34) || chr(13) ||
    28                           chr(10);
    29      ----------------------------------------------------
    30      -- Write the headers
    31      dbms_lob.createtemporary( l_body_html, false, 10 );
    32      dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
    33      ----------------------------------------------------
    34      -- Write the text boundary
    35      l_offset := dbms_lob.getlength(l_body_html) + 1;
    36      l_temp   := '--' || l_boundary || chr(13)||chr(10);
    37      l_temp   := l_temp || 'content-type: text/plain; charset=UTF-8' ||
    38                    chr(13) || chr(10) || chr(13) || chr(10);
    39      dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    40      ----------------------------------------------------
    41      -- Write the plain text portion of the email
    42  /**
    43      l_offset := dbms_lob.getlength(l_body_html) + 1;
    44      dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
    45  **/
    46      ----------------------------------------------------
    47      -- Write the HTML boundary
    48      l_temp   := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
    49                      chr(13) || chr(10);
    50      l_temp   := l_temp || 'content-type: text/html;' ||
    51                     chr(13) || chr(10) || chr(13) || chr(10);
    52      l_offset := dbms_lob.getlength(l_body_html) + 1;
    53      dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    54      ----------------------------------------------------
    55      -- Write the HTML portion of the message
    56      l_offset := dbms_lob.getlength(l_body_html) + 1;
    57      dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
    58      ----------------------------------------------------
    59      -- Write the final html boundary
    60      l_temp   := chr(13) || chr(10) || '--' ||  l_boundary || '--' || chr(13);
    61      l_offset := dbms_lob.getlength(l_body_html) + 1;
    62      dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
    63      ----------------------------------------------------
    64      -- Send the email in 1900 byte chunks to UTL_SMTP
    65      l_offset  := 1;
    66      l_ammount := 1900;
    67      utl_smtp.open_data(l_connection);
    68      while l_offset < dbms_lob.getlength(l_body_html) loop
    69          utl_smtp.write_raw_data(l_connection,
    70              utl_raw.cast_to_raw(
    71                  dbms_lob.substr(l_body_html,l_ammount,l_offset ) ) );
    72          l_offset  := l_offset + l_ammount ;
    73          l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
    74      end loop;
    75      utl_smtp.close_data(l_connection);
    76      utl_smtp.quit( l_connection );
    77      dbms_lob.freetemporary(l_body_html);
    78* end;
    SQL>
    SQL> /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   email_text varchar2(2000);
      3   contract_end_date_v date := sysdate;
      4   name_v varchar2(200) := 'Riaz';
      5   begin
      6    email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||'  المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى  <br/>.ولكم جزيل الشكر والتقدير  </font></div>';
      7    p_html_email_riaz(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
      8*  end;
    SQL> /
    PL/SQL procedure successfully completed.
    Result*
    GaSmO Riaz GacMJQc
    mQLl GaJ_Qc HGaZac Cd GaZ^O GaNGU H_c SmdJem HJGQmN 12-07-2011
    . fZame mQL\l GaJ_\Qc HE]GOI EOGQI GacfGQO GaHTQmI ]m MGa ZOc Q[HJ_c HJLOmO GaZ^O NaGa cOI C^UeG CSHfZmd cd Gamfc fPa_ aaCecmI Ga^Ufl
    .fa_c LRma GaT_Q fGaJ^OmQ
    *Option4*
    [code]
    SQL> ed
    Wrote file afiedt.buf
    1 CREATE OR REPLACE PROCEDURE send_email_html_test(
    2 pi_from IN Varchar,
    3 pi_to IN VARCHAR,
    4 pi_cc IN Varchar,
    5 pi_subj IN VARCHAR,
    6 pi_msg CLOB
    7 )
    8 IS
    9 conn utl_smtp.connection;
    10 lv_mailhost varchar2(1000);
    11 lv_port number;
    12 BEGIN
    13 lv_mailhost := '<smtp Server>';
    14 lv_port := 25;
    15 conn := utl_smtp.open_connection(lv_mailhost, lv_port);
    16 utl_smtp.helo(conn, lv_mailhost);
    17 utl_smtp.mail(conn, pi_from);
    18 utl_smtp.rcpt(conn, pi_to);
    19 IF pi_cc is not null THEN
    20 utl_smtp.rcpt(conn, pi_cc);
    21 END IF;
    22 utl_smtp.open_data(conn);
    23 utl_smtp.write_data(conn, 'MIME-version: 1.0' || utl_tcp.CRLF);
    24 utl_smtp.write_data(conn, 'Content-Type: text/html; charset=iso-8859-6' ||
    25 utl_tcp.CRLF);
    26 utl_smtp.write_data(conn, 'Content-Transfer-Encoding: 8bit' ||
    27 utl_tcp.CRLF);
    28 utl_smtp.write_data(conn, 'From:' ||pi_from || utl_tcp.CRLF);
    29 utl_smtp.write_data(conn, 'To:' ||pi_to || utl_tcp.CRLF);
    30 utl_smtp.write_data(conn, 'Cc:' ||pi_cc || utl_tcp.CRLF);
    31 utl_smtp.write_data(conn, 'Reply-To:' ||pi_from || utl_tcp.CRLF);
    32 utl_smtp.write_data(conn, 'Subject:' ||pi_subj|| utl_tcp.CRLF);
    33 utl_smtp.write_data(conn, utl_tcp.crlf);
    34 utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(pi_msg));
    35 utl_smtp.close_data(conn);
    36 utl_smtp.quit(conn);
    37 EXCEPTION WHEN others THEN
    38 dbms_output.put_line(sqlerrm);
    39* END;
    40 /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
    1 declare
    2 email_text varchar2(2000);
    3 contract_end_date_v date := sysdate;
    4 name_v varchar2(200) := 'Riaz';
    5 begin
    6 email_text :='
    <div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b>
    يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'
    . وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى
    .ولكم جزيل الشكر والتقدير </font></div>';
    7 send_email_html_test('<email@domain>',
    8           '<email@domain>',
    9 '<email@domain>',
    10 'Hello',email_text);
    11* end;
    SQL> /
    PL/SQL procedure successfully completed.
    Result*
    Riaz افكحترك
    ٍرجٌ افترك بافغفك أل افغد افخاص بك سٍلتمٍ بتارٍخ 12-07-2011
    . نغفٍم ٍرجٌ افترك بإادة إدارة افكنارد افبشرٍة ٍ حاف غدك ربتك بتجدٍد افغد خفاف كدة أصما أسبنغٍل كل افٍنك نذف ففأمكٍة افصنٌ
    .نفك جزٍف افشر نافتدٍر
    Option5
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE PROCEDURE send_mail_test1 (p_to        IN VARCHAR2,
      2                                         p_from      IN VARCHAR2,
      3                                         p_subject   IN VARCHAR2,
      4                                         p_text_msg  IN VARCHAR2 DEFAULT NULL,
      5                                         p_html_msg  IN VARCHAR2 DEFAULT NULL,
      6                                         p_smtp_host IN VARCHAR2,
      7                                         p_smtp_port IN NUMBER DEFAULT 25)
      8  AS
      9    l_mail_conn   UTL_SMTP.connection;
    10    l_boundary    VARCHAR2(50) := '----=*#abc1234321cba#*=';
    11  BEGIN
    12    l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
    13    UTL_SMTP.helo(l_mail_conn, p_smtp_host);
    14    UTL_SMTP.mail(l_mail_conn, p_from);
    15    UTL_SMTP.rcpt(l_mail_conn, p_to);
    16    UTL_SMTP.open_data(l_mail_conn);
    17    UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || UTL_TCP.crlf);
    18    UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || UTL_TCP.crlf);
    19    UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || UTL_TCP.crlf);
    20    UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || UTL_TCP.crlf);
    21    UTL_SMTP.write_data(l_mail_conn, 'Reply-To: ' || p_from || UTL_TCP.crlf);
    22    UTL_SMTP.write_data(l_mail_conn, 'MIME-Version: 1.0' || UTL_TCP.crlf);
    23    UTL_SMTP.write_data(l_mail_conn, 'Content-Type: multipart/alternative; boundary="' || l_boundary || '"' || UTL_TCP.crlf || UTL_TCP.crlf);
    24    IF p_text_msg IS NOT NULL THEN
    25      UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
    26      UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/plain; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
    27      UTL_SMTP.write_data(l_mail_conn, p_text_msg);
    28      UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
    29    END IF;
    30    IF p_html_msg IS NOT NULL THEN
    31      UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
    32      UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/html; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
    33      UTL_SMTP.write_data(l_mail_conn, p_html_msg);
    34      UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
    35    END IF;
    36    UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || '--' || UTL_TCP.crlf);
    37    UTL_SMTP.close_data(l_mail_conn);
    38    UTL_SMTP.quit(l_mail_conn);
    39* END;
    SQL> /
    Procedure created.
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2   email_text varchar2(2000);
      3   contract_end_date_v date := sysdate;
      4   name_v varchar2(200) := 'Riaz';
      5   begin
      6    email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||'  المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى  <br/>.ولكم جزيل الشكر والتقدير  </font></div>';
      7    send_mail_test1('<email@domain>',
      8                   '<email@domain>',
      9                         'Hello',
    10                 'msg',
    11                 email_text,
    12                 '<smtp Server>',
    13                 25);
    14*  end;
    SQL> /
    PL/SQL procedure successfully completed.
    Result*
    ????? Riaz ???????
    ???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
    .???? ???? ????? ????????

    I worked with Oracle support and was able to find solution. The helping document ids were: 752309.1 & 404389.1

  • How to send timer job email to "assigned to" feild value in a task list?

    Hi All,
    How to send timer job email  to "assigned to" field value in a task list if due date is after two days from now?

    Create a SharePoint Designer Workflow and use "pause until date" option when an new item is created/update.
    Using Server Object model, I believe you can create the timer job from item event receiver.
    --Cheers

  • How to send a sms email with a 5310

    I am trying to figure out how to send a Sms Email with my new 5310 xpress music it only allows me to enter numbers in the to box

    i would guess that you are trying to write the message possibly in the field designed for a contact name or phone number that you would like to send it to, if you go down to the rest of the lines you will be able to type your message. this is just a guess but it sounds like this might be the issue. if not please elaborate so we can assist you better. 
    You know what I love about you the most, the fact that you are not me ! In love with technology and all that it can offer. Join me in discovery....

  • TS3276 how to send a group email with iPhone 5

    how to send a group email with iPhone 5

    I have a new OSX 27" iMac that is running Maverick. 
    RE: group emails, I am trying to omit individual recients and have tried the following options without success.
    1) Mail- Composing- checked "Automatically- Bcc"
    2) Mail- Composing- unchecked "when sending to a group, show all member addresses"
    The result is that all names continue to show up with email addresses for group emails.
    HELP!  HELP!  HELP!
    Lynn 

  • How to send an group email with text and photo with  out having google trash it

    how to send a group email with imac 21.5   8.1 Yosemite gmail    without having it trashed automatically

    Check the settings on the machine(s) that are trashing it.

  • How to send photos as email attachments???

    This is a ridiculously easy and simple question but I'm a mac newbie and can't figure out how to send photos as email attachments, not embed them in the body of the email. Every time I go to send a picture or group of pictures from i-photo an email message opens....the pictures are embedded in the body of the email and that's how they appear to receipients. In a test, I've sent them to a PC...the message comes through just fine but the photos don't have separate attachments that I can click on and "save as." they come through as bitmap files. Any ideas? THANK YOU.

    It will not ALWAYS fix the problem that this topic is about; I had my Mail preferences set to send as Plain Text and it did not fix the problem. Additionally, since there is NOT an option in Iphoto as you previously noted, it might be confusing to some people.
    However, for those of you who have the same problem, there seems to be a solution that worked for me. I also had the problem that Mail was overriding my sizing preference when I selected them in Iphoto (share > email) and always sending them as small instead of medium as I preferred.
    Since it seems that sometimes Mail does not deploy the plain text default so you need to kick start it to remember. This is how I did it....
    - Select the photos you want and hit SHARE > EMAIL in Iphoto
    - Now, in Mail click on the photo browser button
    - Find another photo in Iphoto via the browser and drag and drop it into the email that you're composing
    - You'll see a size option appear in the bottom right hand corner
    - Playing around with the sizing option a few times kicked it into gear and it seems to be working better since then
    I hope that helps anyone who has had the same problem.

  • HT5312 how to send the rescue email

    i cant figure out how to send the rescue email.

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then go to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address - if it doesn't show then you don't have a rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps : https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57

  • About how to send ALV through email

    Hi  everyone ,
          I have a problem about how to send ALV through email  in background . if someone knows , pls tell me .
    thanks in advance
    Best Regard
    Nick

    I write a test program , but it doesn't work , use any exists ALV program in the system , and use the "sendlist " program to send the email.  what I want is when I restrict some conditons in the selection-screen , then it send ALV to Email .
    Thanks
    Nick

  • Error Using Send Jython HTML Email

    I have imported the procedure from Oracle Support and tried sending mail using Send Jython HTML Email.
    I receive error as below, pls help.
    org.apache.bsf.BSFException: exception from Jython:
    Traceback (most recent call last):
      File "<string>", line 9, in <module>
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 245, in __init__
        (code, msg) = self.connect(host, port)
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 311, in connect
        raise socket.error, msg
    socket.error: (62, 'Connection refused')
      at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.execInBSFEngine(SnpScriptingInterpretor.java:322)
      at com.sunopsis.dwg.codeinterpretor.SnpScriptingInterpretor.exec(SnpScriptingInterpretor.java:170)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java:2472)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:47)
      at oracle.odi.runtime.agent.execution.cmd.ScriptingExecutor.execute(ScriptingExecutor.java:1)
      at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:50)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.processTask(SnpSessTaskSql.java:2913)
      at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2625)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:558)
      at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:464)
      at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:2093)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:366)
      at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:216)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:300)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:292)
      at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:855)
      at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:126)
      at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
      at java.lang.Thread.run(Thread.java:744)
    Caused by: Traceback (most recent call last):
      File "<string>", line 9, in <module>
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 245, in __init__
        (code, msg) = self.connect(host, port)
      File "C:\oracle\product\11.1.1\Oracle_ODI_1\oracledi\client\jdev\extensions\oracle.odi.navigator\scripting\Lib\smtplib.py", line 311, in connect
        raise socket.error, msg
    socket.error: (62, 'Connection refused')

    The underlying error here is -> socket.error: (62, 'Connection refused')
    Please debug in the jython code in your procedure to see if you are passing correct parameters.

  • 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;

  • How to send a predefined email after clicking on an Insert button in a Form?

    Hi,
    I created my form ( three fields) where I enter a three values.
    I want an email be sent every time new values are entered and the insert button clicked.
    Do you know a way on how to do it please?
    Thanks
    Khaled.

    Hi,
    I do not know of a way within Portal to automatically send an email, but the database has a utility (utl_smtp) that will allow you to do so very easily. You can use Portal to insert your data and then put a trigger on your table that fires after the data is inserted that calls a procedure that will send the mail.
    Here is an example of a procedure that I have used to send mail (you can get all of the info on utl_smtp in the Oracle docs). I have a Portal form that allows the user to input three values and once they click 'insert' and the data goes into the table, I have a trigger that fires 'after insert' and runs this procedure:
    PROCEDURE send_register_mail (sender in varchar2,
    email varchar2,
    date_of_class date)
    IS
    mailhost VARCHAR2(30) := 'my.mailserver.com';
    mail_conn utl_smtp.connection;
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, email);
    utl_smtp.rcpt(mail_conn, '[email protected]');
    utl_smtp.open_data(mail_conn);
    utl_smtp.write_data(mail_conn, 'Subject: Platform Training registration request'||utl_tcp.crlf||'Content-Type:text/html;'||utl_tcp.crlf||utl_tcp.crlf);
    utl_smtp.write_data(mail_conn, sender||' would like to attend the POC training scheduled for '|| date_of_class);
    utl_smtp.close_data(mail_conn);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN OTHERS THEN
    -- Handle the error
    htp.p('There was an error processing your registration. Please contact the site administrator');
    END;
    Hope this helps.
    -melissa

  • Sending an HTML email with Automator

    I am trying to send a HTML postcard that I created to a list of 200 friends for a golf tournament. I would like to use Automator to send the emails to each user individually and not to the entire group at once.
    So far I found one Automator action that will create an email message from a Safari page but my trouble is entering the addresses from my address book group for all 200 emails.
    Could someone help me with a workflow?
    Thanks in advance,
    Adam

    Try this
    <%@ page import="sun.net.smtp.SmtpClient,java.io.PrintStream" %>
    <%
    try{
    String host = "IP"; //this is u r IP adress
    String from = "[email protected]"; //mail adress of sender
    String to = "[email protected]"; //mail address whom to
    SmtpClient smtp = new SmtpClient(host);
    smtp.from(from);
    smtp.to(to);
    PrintStream out1 = smtp.startMessage();
    out1.println("To: " + to);
    out1.println("Subject: Hello peter ");
    out1.println();
    out1.println("Hi Peter How r u doing ");
    out1.flush();
    out1.close();
    smtp.closeServer();
    catch(Exception e)
    out.println(e+e.getMessage());
    %>

  • Sending a html email with jsp

    is it possible to send an email with html content and how do i do that

    Try this
    <%@ page import="sun.net.smtp.SmtpClient,java.io.PrintStream" %>
    <%
    try{
    String host = "IP"; //this is u r IP adress
    String from = "[email protected]"; //mail adress of sender
    String to = "[email protected]"; //mail address whom to
    SmtpClient smtp = new SmtpClient(host);
    smtp.from(from);
    smtp.to(to);
    PrintStream out1 = smtp.startMessage();
    out1.println("To: " + to);
    out1.println("Subject: Hello peter ");
    out1.println();
    out1.println("Hi Peter How r u doing ");
    out1.flush();
    out1.close();
    smtp.closeServer();
    catch(Exception e)
    out.println(e+e.getMessage());
    %>

Maybe you are looking for

  • Lockbox and clearing the Open Items

    Hi, I have a requirement and advise me will it be possible with standard SAP . Invoice 1 amt 500 USD Invoice 2 amt 600 USD Lockbox amt   1000 Expectation : Lock Box program should clear both the invoices and create a the diff  of 100 ( 600+500 -1000)

  • Defined table in function module

    i wont to define a table with fields  objid in import tab  how can i do that? thankes

  • How do you tell what version apple tv I have?

    How can I tell what Apple TV version I have?

  • Photoshop CS3 crashing on Save for Web & Devices

    I'm having a problem with Photoshop CS3 crashing every time I use the "Save for Web & Devices" option. It allows me to open the dialog box and configure my file, but as soon as I click Save, it crashes. Has anyone else had this issue and if so, how d

  • Managing disk space on MacBook Air

    Hi all and happy new year! I recently gave my wife a new MacBook Air to replace her aging iBook. Great idea, right? The only thing I didn't count on was how much space she had taken up on the old computer with iTunes and iPhoto libaries. Altogether,