Email review (attachment) query
When starting a shared email review with PDF as an attachment, does Acrobat create a copy of the PDF in the Shared Web Folder?
I thought it did, but I have odd things happening where Tracker displays an icon, but no path for the review file...
Not to my knowledge. Each individual receives a copy of the PDF file in a Email based Review, so the only thing on the server is an XML file that keeps track of the comments each participant makes in the Shared Review.
Similar Messages
-
Attach for email review problem
I am using Acrobat 9.0 Standard to sent documents for email review. However none of the recipients ever see the yellow banner with the "Send Comments" button or the "Comments & Markup" toolbar.
I am using Outlook with Microsoft Exchange Server and mail is defaulted to Plain Text.
I would appreciate any suggestiong on how to correct this problem.
Thank you in advance to any and all who reply.I am having a similar problem. The users of Reader who receive my pdf documents cannot use the comment and markup tools. I have Acrobat Standard 9.1.2 installed in Windows. There are various versions of Reader installed through the company, but none earlier than version 7. The autogenerated text that prints with the emails generated reads as follows:
You are invited to review the document: Intake Fax.pdf. You can use Adobe Acrobat 6 or later to review this document.
Click the attachment to open it in Acrobat, and make your comments using Comment & Markup tools. When you are finished, click "Send Comments" to return your comments to the author.
I had read that creating the document in Word could be the source of the problem, but I have tried creating the document from Notepad and had the same issues. I currently have a pdf created in Acrobat out to a collegue but I don't have the response from him yet.
I also read something about the pdf being saved in one of the ISO formats that prohibits the file from being changed in any way. This doesn't appear to be the case either since my settings state that pdf's created are "regular".
I don't have a clue why this is not working and I would think that Adobe would be on top of this since the ability to share and review documents was one of the primary selling features. I'm sure I am not the only one who thinks this way. -
Attach query output to notification email
hi
i have a user defined metric which sends an email if a query returns more than 3 rows ( select count(*) from mytable;
i also like to have output of below query embedded within the email notification select * from mytable;
is that's possible?
grid v11gYou can send the P.O to required e- mail i.d to vendor provided vendor mail i.d is maintained at General data of Vendor Master, there is standard config. with minor help of ABAP you can do.
However the case you illustrated, it is not possible through only Functional Config settings. -
How to send email with attachment
Hi friends,
I am using soa 11.1.1.7.0
Jdev 11.1.1.7.0
WebLogic:- 10.3
I want to generated email with attachment in BPEL 11g. Below is what i did in my bpel process
Create simple hello world bpel process.
In email activity below details are given
<scope name="Email1">
<bpelx:annotation>
<bpelx:pattern patternName="bpelx:email"></bpelx:pattern>
</bpelx:annotation>
<variables>
<variable name="varNotificationReq"
messageType="ns1:EmailNotificationRequest"/>
<variable name="varNotificationResponse"
messageType="ns1:ArrayOfResponse"/>
<variable name="NotificationServiceFaultVariable"
messageType="ns1:NotificationServiceErrorMessage"/>
</variables>
<sequence name="Sequence1">
<assign name="EmailParamsAssign">
<copy>
<from expression="string('Default')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:FromAccountName"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:FromUserName"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Bcc"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Cc"/>
</copy>
<copy>
<from expression="string('')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:ReplyToAddress"/>
</copy>
<copy>
<from expression="bpws:getVariableData('inputVariable','payload','/client:process/client:subject')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Subject"/>
</copy>
<copy>
<from expression="bpws:getVariableData('inputVariable','payload','/client:process/client:to')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:To"/>
</copy>
<copy>
<from><Content xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"><MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService">multipart/mixed</MimeType><ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"><MultiPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"> <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"><MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/><ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/><BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/></BodyPart> <BodyPart xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"><MimeType xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/><ContentBody xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/><BodyPartName xmlns="http://xmlns.oracle.com/ias/pcbpel/NotificationService"/></BodyPart></MultiPart></ContentBody></Content></from>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content"/>
</copy>
<copy>
<from expression="string('text/html; charset=UTF-8')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[1]/ns1:MimeType"/>
</copy>
<copy>
<from expression="bpws:getVariableData('inputVariable','payload','/client:process/client:body')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[1]/ns1:ContentBody"/>
</copy>
<copy>
<from expression="string('text/plain')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:MimeType"/>
</copy>
<copy>
<from expression="string('SampleStudent.txt')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:BodyPartName"/>
</copy>
<copy>
<from expression="concat('file:///', bpws:getVariableData('inputVariable','payload','/client:process/client:attachmentURI'))"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentBody"/>
</copy>
</assign>
<invoke name="InvokeNotificationService"
portType="ns1:NotificationService"
partnerLink="NotificationService1"
inputVariable="varNotificationReq"
outputVariable="varNotificationResponse"
operation="sendEmailNotification"/>
</sequence>
</scope>
<!--
Asynchronous callback to the requester. (Note: the callback location and correlation id is transparently handled using WS-addressing.)
-->
<invoke name="callbackClient"
partnerLink="sendingemailwithattachmentsprcs_client"
portType="client:SendingEmailWithAttachmentsPrcsCallback"
operation="processResponse" inputVariable="outputVariable"/>
</sequence>
</process>
I am able to generate Email with attachment but i cant see the data in the attached file.
I think i need to convert the data before sending as a attachment. Could someone please help me in generating the txt files.
Regards,
Rajireddy.Re: sending fax
-
Hi Fellows
I am facing an issue with Exchange 2010 SP3 (14.03.0123.003) environment. Internal email sent with attachment to an all employee or large-member distribution group chokes the queue on Hub Transport and takes from 7 to 15 minutes to deliver. during this
time period users's emails are also delayed because of transport queue. I am trying to diagnose the root cause for this. Your suggessions and insight might be helpful for me to get it over quickly.
2 x HT + CAS (WNLB)
2 x MBX (DAG)
UserBase: 5000+
Regards.
J.AHi,
Generally, a message that has a large attachment or many recipients takes longer for a Hub Transport server to process than a small message that's addressed to only one recipient.
In Exchange 2010, after a message is received by the Hub Transport server, the message is added to the Submission queue. Messages move from the Submission queue through the categorizer. When the message is categorized, a recipient's e-mail
address is resolved to an object in Active Directory. This query determines the mailbox associated with that e-mail address and which Mailbox server is hosting that mailbox.
For more information about Internal message Routing, please refer to the following link.
http://technet.microsoft.com/en-us/library/bb232193(v=exchg.141).aspx
In addition, Slow network bandwidth will effect email delivery. We can increase the network bandwidth to take a test. Low computer performance will also affect the delivery. If sending internal email without attachment to all employee or
large-member distribution group, will they take the same long time to deliver?
Best Regards. -
When replying to an email with attachment, later when I need to review the attachedment, it can't and just gives a file name <????.pdf> i tried to search my downloads and documents for the file pdf but cant be located.
It seems that attachments are lost when you reply to an email?
Look forward to resolving this problem with LionTry a reset ...
Press and hold the Sleep/Wake button and the Home button together for at least ten seconds, until the Apple logo appears.
If that doesn't help, tap Settings > General > Reset > Reset All Settings
No data is lost due to a reset. -
BPEL send email with attachment
Hi guys,,
Now i want to send email with attachment from the bpel console. In bpel console, if i want to use, "browse" button, how can i create this button in my xsd file?Hello,
Well I'm using the BPEL build in decoder. It works for txt file but how about PDF? Will it be the same?
it give me this message in the email process.
XML Parsing Error: reference to invalid character number
p/s: it working to txt but not pdf.
below is the script
<bpelx:exec name="decoder" language="java" version="1.5">
<![CDATA[String inputString = new String();
inputString =(String)getVariableData("attachmentContentVar");
try {
String decoded = Base64Decoder.decode(inputString);
setVariableData("decoded",decoded);
catch(Exception e)
e.printStackTrace();
}]]>
</bpelx:exec>
<copy>
<from variable="retriveAttachment_retriveAttachmentSelect_TASKID_OutputVariable"
part="WfattachmentCollection"
query="/ns3:WfattachmentCollection/ns3:Wfattachment/ns3:encoding"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:MimeType"/>
</copy>
<copy>
<from variable="retriveAttachment_retriveAttachmentSelect_TASKID_OutputVariable"
part="WfattachmentCollection"
query="/ns3:WfattachmentCollection/ns3:Wfattachment/ns3:name"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:BodyPartName"/>
</copy>
<copy>
<from expression="bpws:getVariableData('decoded')"/>
<to variable="varNotificationReq" part="EmailPayload"
query="/EmailPayload/ns1:Content/ns1:ContentBody/ns1:MultiPart/ns1:BodyPart[2]/ns1:ContentBody"/>
</copy>
</assign>
Edited by: kpchong on Oct 20, 2009 12:00 AM -
I am using the "Attach for Email Review" function, but it isn't working for people on a PC. I initiate this from my Mac, and as I set it up, the wizard works fine, and there are no alerts or anything that would indicate that it's not going to work.
Everyone gets the email and the attachment, but Acrobat only recognizes that Mac users are participating in the review. They clearly see the banner at the top of the window that displays the Send Comments button, and this is clearly missing when a PC user opens the document.
We are all on Acrobat9 Pro, and BTW, I'm testing on IT professionals (I'm not ruling out user error, but it's unlikely). The only difference I can tell is that some are PC and some are Macs.
What could be the problem?Further testing: same problem with Acrobat Pro X.
But with Acrobat Pro 9 it works fine.
(all on the same system mentioned above)
From this i conclude that the fault does lie with the version of the PDF.
So the weird thing is why you cant reproduce the problem.
Did you test with the test file i sent you?
Ps.
I took a look into my invoice archive...
Invoices with PDF version 1.3 and 1.4 do NOT work, but an invoice with version 1.5 works fine.
This supports above conclusion if you ask me.
Ps2.
The test system i used is Windows 7 32bits. -
I have tried a lot to find an app or some way in email to attach multiple of pdf files in one email. I could not find anything that sends multiple pdf file in one email and still keeping the file in simple pdf format for the recipient.
I am not aware of a way except for photos that allows you to select multiple files in an email. I even checked settings in the Adobe Reader app, and it does not show that ability.
-
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; -
Convert the spool to xls format and email through attachment to the user
Hi all,
When I execute a report in background, I get spool. I need to convert the spool to xls format and email through attachment to the user.The xls file should not be saved on local system.
If I use the Spool Recepient tab in SM37 it mails the spool list as .txt file to the mail receipient. But I need to send it as an .xls file.
Can any one help me on thisDid you get the solution? i have the same problem.
-
Dunning letter (email) PDF attachment or body of email
Hi experts,
What is the industry practice for dunning letters when sent via email? Attach them as a pdf to the email, or add all the content of the dunning letter to the body of the email to make it easier for the customer to receive the message?
Thanks,
MarioHi Mario,
It all depends on the functionality that and payment option that are provided.
If the dunning letters contains and payment/remittance slip(through which customer can make payment in bank, outlet or post office) than the letter should go as PDF attached to mail with body saying that its the reminder for payment being missed,
But if the payment option is not like as described above than you can send the the letter in html body mail.
Regards -
Problem by Sending an Email with attached Adobe Interactive Form (Code)
Thanks. I have written Programm, but it does not work as i want it to do. I will send an Email with attached Adobe Interactive Firm to [email protected]. I tried it with "*lo_recipient = cl_sapuser_bcs=>create( sy-uname )" at the marked(bold, fat) position. It worked but the Email was send to my SAP-Account, but i want to send to [email protected], so I tried this (see at code in bold, fat):
lo_rec TYPE adr6-smtp_addr VALUE '[email protected]'. " Empfänger Receiver
lo_recipient = cl_cam_address_bcs=>create_internet_address( lo_rec ).
But it doens`t send the email.
Can anybody help me please???
Kevin
Here my Code:
Report FP_EXAMPLE_01
Printing of documents using PDF based forms
REPORT z_example_02.
Data declaration
DATA: carr_id TYPE sbook-carrid,
customer TYPE scustom,
bookings TYPE ty_bookings,
connections TYPE ty_connections,
fm_name TYPE rs38l_fnam,
fp_docparams TYPE sfpdocparams,
fp_outputparams TYPE sfpoutputparams,
error_string TYPE string,
l_booking TYPE sbook,
t_sums TYPE TABLE OF sbook,
l_sums LIKE LINE OF t_sums,
fp_formoutput TYPE fpformoutput.
PARAMETER: p_custid TYPE scustom-id DEFAULT 38.
SELECT-OPTIONS: s_carrid FOR carr_id DEFAULT 'AA' TO 'ZZ'.
PARAMETER: p_form TYPE tdsfname DEFAULT 'FP_EXAMPLE_01'.
PARAMETER: language TYPE sfpdocparams-langu DEFAULT 'E'.
PARAMETER: country TYPE sfpdocparams-country DEFAULT 'US'.
Get data from the following tables: scustom(Flight customer)
sbook (Single flight reservation)
spfli (Flight plan)
SELECT SINGLE * FROM scustom INTO customer WHERE id = p_custid.
CHECK sy-subrc = 0.
SELECT * FROM sbook INTO TABLE bookings
WHERE customid = p_custid
AND carrid IN s_carrid
ORDER BY PRIMARY KEY.
SELECT * FROM spfli INTO TABLE connections
FOR ALL ENTRIES IN bookings
WHERE carrid = bookings-carrid
AND connid = bookings-connid
ORDER BY PRIMARY KEY.
Print data:
First get name of the generated function module
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = p_form
IMPORTING
e_funcname = fm_name.
IF sy-subrc <> 0.
MESSAGE e001(fp_example).
ENDIF.
Set output parameters and open spool job
fp_outputparams-nodialog = 'X'. " suppress printer dialog popup
fp_outputparams-getpdf = 'X'. " launch print preview
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = fp_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
Set form language and country (->form locale)
fp_docparams-langu = language.
fp_docparams-country = country.
*fp_docparams-fillable = 'X'.
*fp_docparams-langu = 'E'. "wird jetzt automatisch gesetzt, bzw. kann dynamisch verändert werden
*fp_docparams-country = 'GB'. "wird jetzt automatisch gesetzt, bzw. kann dynamisch verändert werden
currency key dependant summing
LOOP AT bookings INTO l_booking.
l_sums-forcuram = l_booking-forcuram.
l_sums-forcurkey = l_booking-forcurkey.
COLLECT l_sums INTO t_sums.
ENDLOOP.
Now call the generated function module
CALL FUNCTION fm_name
EXPORTING
/1bcdwb/docparams = fp_docparams
customer = customer
bookings = bookings
connections = connections
t_sums = t_sums
IMPORTING
/1bcdwb/formoutput = fp_formoutput
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
CALL FUNCTION 'FP_GET_LAST_ADS_ERRSTR'
IMPORTING
e_adserrstr = error_string.
IF NOT error_string IS INITIAL.
we received a detailed error description
WRITE:/ error_string.
EXIT.
ELSE.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.
Close spool job
CALL FUNCTION 'FP_JOB_CLOSE'
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*********************Send the form*******************
*********************to the Customer*****************
*********************via Email***********************
*IF i_down = abap_true.
DATA: filename TYPE string,
path TYPE string,
fullpath TYPE string,
default_extension TYPE string VALUE 'PDF'.
Data:
lt_att_content_hex TYPE solix_tab.
*DATA: data_tab TYPE TABLE OF x255.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = fp_formoutput-pdf
TABLES
binary_tab = lt_att_content_hex.
CLASS cl_bcs DEFINITION LOAD.
DATA:
lo_send_request TYPE REF TO cl_bcs VALUE IS INITIAL.
lo_send_request = cl_bcs=>create_persistent( ).
DATA:
lt_message_body TYPE bcsy_text VALUE IS INITIAL.
DATA: lo_document TYPE REF TO cl_document_bcs VALUE IS INITIAL.
APPEND 'Dear Vendor,' TO lt_message_body.
APPEND ' ' TO lt_message_body.
APPEND 'Please fill the attached form and send it back to us.'
TO lt_message_body.
APPEND ' ' TO lt_message_body.
APPEND 'Thank You,' TO lt_message_body.
lo_document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = lt_message_body
i_subject = 'Vendor Payment Form' ).
DATA: lx_document_bcs TYPE REF TO cx_document_bcs VALUE IS INITIAL.
TRY.
lo_document->add_attachment(
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = 'Vendor Payment Form'
i_att_content_hex = lt_att_content_hex ).
CATCH cx_document_bcs INTO lx_document_bcs.
ENDTRY.
lo_send_request->set_document( lo_document ).
DATA:
lo_sender TYPE REF TO if_sender_bcs VALUE IS INITIAL,
lo_send TYPE adr6-smtp_addr VALUE '[email protected]'. "Absender SENDER
lo_sender = cl_cam_address_bcs=>create_internet_address( lo_send ).
Set sender
lo_send_request->set_sender(
EXPORTING
i_sender = lo_sender ).
Create recipient
DATA:
lo_recipient type ref to if_recipient_bcs value is initial.
Data:
lo_rec TYPE adr6-smtp_addr VALUE '[email protected]'. " Empfänger Receiver
lo_recipient = cl_cam_address_bcs=>create_internet_address( lo_rec ).
*lo_recipient = cl_sapuser_bcs=>create( sy-uname ).
Set recipient
lo_send_request->add_recipient(
EXPORTING
i_recipient = lo_recipient
i_express = 'X' ).
*lo_send_request->add_recipient(
*EXPORTING
*i_recipient = lo_recipient
*i_express = 'X' ).
Send email
DATA: lv_sent_to_all(1) TYPE c VALUE IS INITIAL.
lo_send_request->send(
EXPORTING
i_with_error_screen = 'X'
RECEIVING
result = lv_sent_to_all ).
COMMIT WORK.
MESSAGE 'The payment form has been emailed to the Vendor' TYPE 'I'.Hi Kevin,
Please try this code to send your mail, i wrote it and works well in many system.
Take care if in your profile you got an e-mail adress define .
Take care also of trnasaction SCOT customizing, are you able to send mail to e-mail adress ?
Let me know if it's works.
Best regards.
<i>**----
CLASS-DEFINITIONS
DATA: send_request TYPE REF TO cl_bcs.
DATA: document TYPE REF TO cl_document_bcs.
DATA: sender TYPE REF TO cl_sapuser_bcs.
DATA: recipient TYPE REF TO if_recipient_bcs.
INTERNAL TABLES
DATA: l_mailtext TYPE soli_tab.
DATA: iaddsmtp TYPE TABLE OF bapiadsmtp.
DATA: ireturn TYPE TABLE OF bapiret2.
VARIABLES
DATA: mail_line LIKE LINE OF l_mailtext.
DATA: bapiadsmtp TYPE bapiadsmtp.
DATA: subject TYPE so_obj_des.
DATA : att_subject TYPE so_obj_des.
DATA : w_except TYPE REF TO cx_root .
CONSTANTS : c_defmail TYPE ad_smtpadr VALUE
'[email protected]' .
FIELD-SYMBOLS : <smtp> TYPE bapiadsmtp.
*Convert the pdf given by function module into Binary .
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = output-pdf "PDF file from function module
TABLES
binary_tab = hexa.
*Set subject of the mail
subject = 'Exemple de PDF interactif'.
Set text of the mail
mail_line = 'Merci de remplir le formulaire et nous le retourner'.
APPEND mail_line TO l_mailtext .
Set the name of the attached document
att_subject = 'Template du PDF'.
TRY.
Create persistent send request
send_request = cl_bcs=>create_persistent( ).
Get sender object
sender = cl_sapuser_bcs=>create( sy-uname ).
Add sender
CALL METHOD send_request->set_sender
EXPORTING
i_sender = sender.
Read the E-Mail address for the user
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = sy-uname
TABLES
return = ireturn
addsmtp = iaddsmtp.
LOOP AT iaddsmtp ASSIGNING <smtp> WHERE std_no = 'X'.
CLEAR bapiadsmtp.
MOVE <smtp> TO bapiadsmtp.
ENDLOOP.
CASE bapiadsmtp-e_mail.
WHEN space.
No adress main for user, so send it to the default mail adress
recipient =
cl_cam_address_bcs=>create_internet_address( c_defmail ).
WHEN OTHERS.
recipient =
cl_cam_address_bcs=>create_internet_address( bapiadsmtp-e_mail ).
ENDCASE.
Add recipient with its respective attributes to send request
CALL METHOD send_request->add_recipient
EXPORTING
i_recipient = recipient
i_express = 'X'
i_copy = space
i_blind_copy = space
i_no_forward = space.
Set that you don't need a Return Status E-mail
CALL METHOD send_request->set_status_attributes
EXPORTING
i_requested_status = 'E'
i_status_mail = 'E'.
set send immediately flag
send_request->set_send_immediately( 'X' ).
*Build Document
document = cl_document_bcs=>create_document(
i_type = 'RAW'
i_text = l_mailtext
i_subject = subject ).
add attachment to document
CALL METHOD document->add_attachment
EXPORTING
i_attachment_type = 'PDF'
i_attachment_subject = att_subject
i_att_content_hex = hexa.
Add document to send request
CALL METHOD send_request->set_document( document ).
Send document
CALL METHOD send_request->send( ).
COMMIT WORK.
CATCH cx_send_req_bcs INTO w_except.
CATCH cx_address_bcs INTO w_except.
CATCH cx_document_bcs INTO w_except.
ENDTRY.</i> -
XML Bursting ... Getting email but attachment is missing
Hi,
We have recently applied patch 5968876 which created concurent program for xml bursting.
I have created a control file and uploaded that in the data definitions. Now when I run xml bursting program and pass request id of my report, the program is completing and emailing with expected subject and body. But the problem is that PDF report is not attached with it.
bursting output has following message
pdf email success
Error while generating the Document...
my control file is
<?xml version="1.0" encoding="UTF-8"?>
<xapi:requestset xmlns:xapi="http://xmlns.oracle.com/oxp/xapi" type="bursting">
<xapi:request select="/DWDRAXINV/LIST_G_ORDER_BY/G_ORDER_BY/LIST_G_INVOICE/G_INVOICE">
<xapi:delivery>
<xapi:email id="123" server="xxxx.com" port="25" from="[email protected]" reply-to ="[email protected]">
<xapi:message id="123" to="[email protected]" attachment="true" subject="Your Invoice #${TRX_NUMBER} ${BILL_CUST_NAME}">Dear Sir/Madam,
Please find attached your invoice #${TRX_NUMBER} for ${BILL_CUST_NAME} dated ${TRX_DATE}
Your payment terms for this invoice are ${G_INV_TERM[1]/TERM_NAME}.
Please pay on time.
Regards
Finance</xapi:message>
</xapi:email>
</xapi:delivery>
<xapi:document output-type="pdf" delivery="123">
<xapi:template type="rtf"
location="/xx/xx/xx/11.5.0/xml/RAXINV.rtf">
</xapi:template>
</xapi:document>
</xapi:request>
</xapi:requestset>
Please reply as this is very urgent.
Appreciate your help and thanks in advanceHi Velkit,
Check under your "Share" menu. It should be there. If it isn't there either, make sure that "Mail" is your default email client and then look under the share menu.
Hope this helps,
JediKMan -
How can I email a video clip I downloaded into my iPhoto library to my friends? I tried creating an email and attaching the clip but there is no sound and no picture when the 5 minute attachment "plays." How can I file=>export it to them from iPhoto?
Have them install Quicktime on their PC's from Apple's website, that's the easiest fix.
Maybe you are looking for
-
Urgent help for processing XML stream read from a JAR file
Hi, everyone, Urgently need your help! I am reading an XML config file from a jar file. It can print out the result well when I use the following code: =============================================== InputStream is = getClass().getResourceA
-
When clicking on the any app it always downloads the rdp file. is there a way to stop this? in 2008 it would just run
-
Horizontal Spry Subenu didn't roll down correctly in IE
Hi, My Horizontal Spry submenu couldn't display properly only in IE. the submenu will appear on the top of the page. In Firefox, the submenu will roll down below the menu. Any idea how to solve this issue?
-
Stuffed up during the factory reinstallm​ent
i own a tablet X200 Lenova. recently i made a product recovery media (3 discs) and then tried reformatting the laptop by restoring to the faculty state but now its even worse then before. none of the problems work and constently a message says "blahb
-
Configurator not saving changes (Web Content)
Hi. I am new to configurator. I have applied a base profile (many different settings) together with a separate profile for restricted websites. The base filter's 'Web Content Filter' is not set. The 'TwinsWebFilter' only has one payload ...the Web Co