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;

Similar Messages

  • 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 a file as an attachment using mailx

    Hi
    Can any one tel me how to send a file as an attachment using mailx command in shell script.
    Thanks,
    Suman.

    Wrong forum where to ask such questions.
    Check this one link:
    http://www.unix.com/shell-programming-scripting/18370-sending-email-text-attachment-using-mailx.html?t=18370#post70254

  • How to send invoice through email with output type RD00?

    What are the configuration settings to send invoices through email with output type RD00?

    Hi,
    Please go through the following links:
    [E-mail|Email Configuration Settings]
    [e-mail|Re: EMAIL BILLING DOCUMENT TO CUSTOMER THROUGH SEND MAIL OPTION IN VF02]
    After triggering the output,goto T.Code SOST and process it.
    So that e-mail will be triggered immediately.
    You can use External send/EDI/simple mail for this.
    Regards,
    Krishna.

  • How to send a conditional email with interactive report subscription

    Hi,
    i have an interactive report with subscription.
    I would like to send an email with the attachment only when the query returns one or more records.
    How to to this?
    Apex 4.0.2
    Thanks in advance
    lukx

    Well, to understand your requirements can I ask this:
    You said earlier you want a report sent whenever records that meet a criteria exist, correct? So you want the application to query for a condition, and when that condition occurs (a row with primary Key = X, a select COUNT(1) for rows with column X returns a result of 1 or more)
    Then you would schedule a batch job:
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Send_Email_Procedure',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN Test_For_COND_SEND(); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=hourly; byminute=0',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    END;
    This would in theory run hourly and run your test_for_cond_Send process, in which you would test for the condition and send an e-mail if it was found that would contain the results from your query/report.
    Here is a link to generate a PDF report that could be sent via e-mail: Re: how to save pdf in APEX 3.0
    Thank you,
    Tony Miller
    Webster, TX
    While it is true that technology waits for no man; stupidity will always stop to take on new passengers.

  • Send PO External email with attachement and Body text

    Hi,
    I need to send Purchase Orders to Vendors as PDF attachments to emails; I have successfully configured all the necessary to send external email with PDF attachement but I want to add text in the body of the email:
    For Output Type NEU
       Access to conditions (General Data) set to X the Replacement of text symbols is SAPMM06E/TEXT_SYMBOL_REPLACE and I fill the text in the Mail Title and Texts. The email was send with all the information : Attachement, title with PO number but with no text in the body.
    Can somebody help me with this issue.
    best regards
    Andre

    Hi,
       My file is "PO Number APM - 123456.dpf". You have to config the "Define Message Types for Purchase Order" in the section Mail title and texts with NEU output type. But don't forget to put the program name SAPMM06E
    Look at
    [purchase order as email - SAPMM06E and TEXT_SYMBOL_REPLACE|purchase order as email - SAPMM06E and TEXT_SYMBOL_REPLACE]
    Best regards
    Andre

  • Email with Attachment using Oracle HTML db code

    Sending E-mail using HTMLDB_MAIL.SEND command successfully executed, but i need to send mail message with file Attachment using ORACLE Apex Processes.
    Can anyone know the procedure to send e-mail with Attachment file.Help me to Proceed.
    Thanks in Advance.

    Hi,
    Search the forum using 'attachment' and you will find the solution to your problem.
    Keep Smiling,
    Bob R

  • How to send an email with attachment using shareponit 2013

    Hi Team,
    I have a PowerView report in my PowerPivot gallery and I want to export it to a PDF file then email it to id. Also I need this to be scheduled. 
    Kindly suggest on the steps!
    Thanks in Advance!!
    Thanks,
    Arsath.

    Create a customcode to export the powerview report to powerpoint and then a small email script will do 
    http://office.microsoft.com/en-in/excel-help/export-a-report-from-power-view-in-sharepoint-to-powerpoint-HA102834765.aspx
    http://technet.microsoft.com/en-us/library/hh231522%28v=sql.110%29.aspx
    I could not find a way to do so but check below:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/fd9e90e2-ebc5-4dfb-9eaf-a263729b8ed2/how-to-generate-powerview-model-programmatically?forum=sqlreportingservices
    If this helped you resolve your issue, please mark it Answered

  • Sending email with attachment using F110

    Hi All,
    My requirement is to be able to send the remitance advice created through F110 in the form of an email attachment.
    This takes up program RFFOUS_T.I am able to send the email but the problem is i dont see the body nor do I see the attachment.
    Pl. let me know if any configuration or any customization needs to be done?
    Thanks and regards,
    A

    // Send the message
    Transport trans = session.getTransport("smtp");
    trans.connect(host,"SMTP_AUTH_USER","SMTP_AUTH_PWD");
    Transport.send( message );My e-mail program that uses authentication to permit relaying only has the last of these three lines of code, not the first two. Apart from that it looks very similar to yours. So try removing those other two lines. I assume your user and password are actually correct for the mail server?

  • How to send PLAIN text email from sp_send_dbmail using SQL Server 2008 R2?

    I have configured Database Mail in SQL Server 2008 R2 (64) and it sends emails just fine. However the destination is recieving the body of thes message as Base 64 encoding.
    Snippet:
    EXEC msdb..sp_send_dbmail @profile_name='Outmail', @recipients = @recpts, @subject = @subj, @body_format = 'TEXT', @body=@body2;
    As you can see I set @body_format to TEXT, but it still sends Base 64. I need to send plain ASCII text. How can I change this?

    I am having this exact issue too.  I have a trigger that sends an email using a stored procedure.  The dbmail is sending the email using the Exchange 2010 server SMTP.  It does not login so the email is relayed as user = "Anonymous". 
    The SQL dbmail email header is showing the following:
    Content-Type: text/plain; charset="utf-8"
    Content-Transfer-Encoding: base64
    MIME-Version: 1.0
    X-MS-Exchange-Organization-AuthSource: MX01.domain.local
    X-MS-Exchange-Organization-AuthAs: Anonymous
    Here is the header if I send via Outlook profile using the legacy program I am trying to automate using SQL Server 2008R2:
    Content-Type: application/ms-tnef; name="winmail.dat"
    Content-Transfer-Encoding: binary
    MIME-Version: 1.0
    X-MS-Has-Attach:
    X-MS-Exchange-Organization-SCL: -1
    X-MS-TNEF-Correlator: <[email protected]>
    MIME-Version: 1.0
    X-MS-Exchange-Organization-AuthSource: MX01.domain.local
    X-MS-Exchange-Organization-AuthAs: Internal
    X-MS-Exchange-Organization-AuthMechanism: 03
    X-Originating-IP: [192.168.13.66]
    Any help would be greatly appreciated!

  • How to send an email with attachment to dynamic emial address using PL/SQL

    Hi,
    i want to send an automated email with attachment everyday to differnet people so number people is not static.
    so is it any way using PL/SQL ?
    thanks for your support!

    i want to send an automated email with attachment everyday to differnet people so number people is not static.
    Why? Explain it.
    You can create a table and store your email id through front-end application day to day.
    The table should look like this ->
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
    PL/SQL Release 10.2.0.3.0 - Production
    CORE    10.2.0.3.0      Production
    TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
    NLSRTL Version 10.2.0.3.0 - Production
    Elapsed: 00:00:00.04
    satyaki>
    satyaki>
    satyaki>create table email_master
      2    (
      3       email_grp_header         varchar2(30) not null,
      4       craete_time                  timestamp,
      5       constraints pk_header primary key(email_grp_header)
      6    );
    Table created.
    Elapsed: 00:00:02.12
    satyaki>
    satyaki>create table email_chld
      2    (
      3       email_grp_header          varchar2(30) not null,
      4       email_recepient             varchar2(100),
      5       craete_time                   timestamp,
      6       constraint fk_header foreign key(email_grp_header) references email_master(email_grp_header)
      7    );
    Table created.
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>
    satyaki>insert into email_master values('GRP_INVENTORY',systimestamp);
    1 row created.
    Elapsed: 00:00:00.07
    satyaki>
    satyaki>
    satyaki>insert into email_master values('GRP_PURCHASE',systimestamp);
    1 row created.
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>commit;
    Commit complete.
    Elapsed: 00:00:00.04
    satyaki>
    satyaki>select * from email_master;
    EMAIL_GRP_HEADER               CRAETE_TIME
    GRP_INVENTORY                  24-OCT-08 08.55.36.190000 PM
    GRP_PURCHASE                   24-OCT-08 08.55.54.481000 PM
    Elapsed: 00:00:00.18
    satyaki>
    satyaki>
    satyaki>insert into email_chld values('GRP_INVENTORY','[email protected]',systimestamp);
    1 row created.
    Elapsed: 00:00:00.07
    satyaki>
    satyaki>insert into email_chld values('GRP_INVENTORY','[email protected]',systimestamp);
    1 row created.
    Elapsed: 00:00:00.04
    satyaki>
    satyaki>insert into email_chld values('GRP_INVENTORY','[email protected]',systimestamp);
    1 row created.
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>insert into email_chld values('GRP_PURCHASE','[email protected]',systimestamp);
    1 row created.
    Elapsed: 00:00:00.03
    satyaki>
    satyaki>insert into email_chld values('GRP_PURCHASE','[email protected]',systimestamp);
    1 row created.
    Elapsed: 00:00:00.11
    satyaki>commit;
    Commit complete.
    Elapsed: 00:00:00.05
    satyaki>
    satyaki>select * from email_chld;
    EMAIL_GRP_HEADER               EMAIL_RECEPIENT                                                                                      CRAETE_TIME
    GRP_INVENTORY                  [email protected]                                                                                      24-OCT-08 08.56.46.107000 PM
    GRP_INVENTORY                  [email protected]                                                                                         24-OCT-08 08.57.03.551000 PM
    GRP_INVENTORY                  [email protected]                                                                                    24-OCT-08 08.57.36.277000 PM
    GRP_PURCHASE                   [email protected]                                                                                      24-OCT-08 08.58.06.129000 PM
    GRP_PURCHASE                   [email protected]                                                                                    24-OCT-08 08.58.26.900000 PM
    Elapsed: 00:00:00.10
    satyaki>And, then based on the group header you can get the list of recipient and use it dynamically inside your PL/SQL Application.
    Regards.
    Satyaki De.

  • 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

  • Friends on Android galaxy do not receive my emails with attached photos sent from my iPhone.  Why

    I have an iPhone 4 running 6.1 OS.  Several times I have taken photos with my iPhone and then tried to email them from my iPhone to friends using Android Galaxy.  They never receive the emails. When I select the photo to be emailed from "Camera Roll", several options appear  (Mail, Message, Photo Stream, Twitter, Facebook etc).  I select "Mail", then select an email address from my contact list, add some text to the message, select the size of photo and send.  The email with attached photo is never received.  Any idea why?

    Well, your response about MMS is beyond my understanding unfortunately.   Don't understand too well this issue of MMS and IMessage. I checked my settings and "Send as MMS" was OFF.  I have turned it ON and tried to re-send the photos.  No word yet if it was received..  Also, the "send and receive" addresses in the "Messages" setting only included my "@me" email address, and not my Yahoo address, which I am trying to add.  It doesn't seem to be able to complete the verification process for that Yahoo address (it remains in a perpetual state of "verifying"), although it did add an "icloud" address, and my cell phone number.   I have my "cellular data" turned OFF because I am in the States (I am Canadaian) and wish to restrict roaming charges.  So are you saying that I cannot send photo attachments in emails from my iPhone, while connected to the in-house internet modem/router - ie., that I can do so only if my "cellular data" setting is ON?  Then why do the messages still appear in the SENT folder?  Do the settings on the recipient phone have an impact?  It doesn't seem so because they were able to receive the messages from the PC/Hotmail source.

Maybe you are looking for

  • How do I create a path so scans to a Windows server come to my iMac.

    I'm the only Mac user in a PC office.  Scanned docs for me now go into a folder on the server which I have to access from a PC and then move contents to my DropBox.  Is there a way to configure the scanners so my scanned docs come into a folder on my

  • Audigy 4 pro sound card HELL please advise!!!

    hi all, right i'll TRY to keep it simple!..... BEFORE my (recently brand new) hard dri've died and caused me all sorts of probs (and ?300) my soundcard was fine it was : windows 7 audigy 4 cubase 4 daniel k's drivers (i think OR it was the one that c

  • Procedure to Upload file in IMG

    Dear SAP Bosessss,    Please help me out for uploading the  file for IMG . Any documents will be great help. I have tried to do this with LSMW and SHDB both r not working properly . Thanks in advance Cheers Magesh

  • Resizeing issues between Illustrator and Indesign

    I am trying to import an illustrator image into indesign for a business card. Every time I try to bring it over to indesign it changes size. However when I look at it's dimensions in the control panel in indesign the size appears to be the same as be

  • About external procurement profile

    Hi guys can you tell me whats External procurement profile? Does this profile does not allow to transfer PR to SRM using CPPR esoa. I got below error when i click Transfer to central system button in CPPR screen. PR xxxxx item xxxx has External procu