Send as HTML
I have an email template that works just fine with a work flow but when I check the box "Send as HTML", the email does not go out. Everything else being equal, it seems like this check box is jamming up the works. I really don't have HTML in the
message body just yet but does this really matter?
Reason I would like HTML format is so I can put a couple of MailTo links in the template.
Well, it's not getting blocked for sure. It just started working and it might have something to do with the format of the template like invalid HTML code causing an issue. Not sure.
I created the entire template in text and then found an HTML converter on the Internet which worked nicely to change the format allowing the use of the MailTo links.
That said, I am trying to figure out how to get the Managers name into the email that goes to them when a Change gets created and their is a Review Activity that needs their Attention. Right now, the email to the Manager just starts off with "A Review
Activity requires your attention.....etc".
Would be nice if it started with Dear "Managers Name". Then the body of the email with all the text.
It's a Review Activity and I fiddled with the template trying all different variables but nothing seems to work. The Manager gets the email because the box Line Manager should review is checked in the RA so Service Manage knows who to send the email to.
Similar Messages
-
OAS 4.0.8 fail to send complete HTML from PL/SQL sp
OAS 4.0.8 may fail to send complete HTML response from the PL/SQL cartridge sometimes. It also varies with different browsers or even with different versions of the same browser. Sometimes it works OK, sometimes the HTML was broken. I tried to figure out the reason, but only realized that the proxy server might cause the problem. As I disabled the proxy server setting on my browser at school(the server is on campus), it worked. However, as I did the same thing at home, it did not work. I am confused what the problem is. That trouble never happened for the previous version OAS 3.0.1. Anybody can help me with that. The ORACLE staff in Taiwan did not come out with the solutions!
OAS 4.0.8 may fail to send complete HTML response from the PL/SQL cartridge sometimes. It also varies with different browsers or even with different versions of the same browser. Sometimes it works OK, sometimes the HTML was broken. I tried to figure out the reason, but only realized that the proxy server might cause the problem. As I disabled the proxy server setting on my browser at school(the server is on campus), it worked. However, as I did the same thing at home, it did not work. I am confused what the problem is. That trouble never happened for the previous version OAS 3.0.1. Anybody can help me with that. The ORACLE staff in Taiwan did not come out with the solutions!
-
How can i send a HTML by email??
When i am sending a HTML he shows the code in the mail instead of showing the HTML page??
Anyone knows how can i solve tyhis??are you setting the content type to text/html? there are plenty of examples out there (and in here). run a search.
-
Workflow- sending a html file in a mail(outlook)
Hi Guys,
i want to send a html file in a mail(outlook) in workflow. whenever enduser click that file its open automatically sap inbox.
html file belongs to a logo, if we click on that file it will automatically opens the SAP INBOX.
this is the my requirement.
give me suggestion for this requirement or any other solution.
we appriciate your reply.
Thanks
Sankar.
Message was edited by: sankar suryaUnless you are prepared to zip and email every folder and
file related to
the page,
exactly as it is on your computer, it would be wiser to
upload it all to
your hosting
server, and send a link to the recipient.
"2start" <[email protected]> wrote in
message
news:erat61$h8m$[email protected]..
>I need to email a frame page I have created in
DreamWeaver.. How can I do
>that? -
How to send an HTML email?
Hey guys
For the longest time I've been wanting to send HTML emails with Mail, not for promotional stuff, but more for thanking our clients for their business. This is the perfect holiday season to send a Thank You email to them, but I don't want just to send a plain and boring text email, I want graphics on it. I know this wasn't possible to do with any previous OSX until Tiger. This is what the Mail page says... - HTML Message Composition - Mail uses the Safari engine to format newly composed email using HTML. I read another post about an HTML Script to work with mail but it got so confusing that I wasn't able to make it work. Can anybody tell how to make this work? A step-by-step tutorial would be great, not just for me but for all those Mail users that are trying to do the same thing. If Apple can send those HTML emails and Newsletters, why can't we? I don't think they're using a Windows computer or any other email software to do this. Better not! :P
This is the post I read, but it was posted a year ago, so I know there's got to be something more up to date.
http://discussions.apple.com/message.jspa?messageID=667497&ft=y&#667497
Thanks a lot in advance!Hello Luis.
Although RTF with Tiger Mail is basic HTML, you can't compose complex HTML within the body of a message.
You can use an HTML composer of choice to include embedded images/graphics and/or objects that are stored on a server (to be downloaded/rendered from the server) when the message is opened by recipients instead of attaching images/graphics to the message.
After saving the document, you can open the document with Safari to ensure the layout and settings are correct and at the menu bar, choose Edit > Mail Contents of This Page.
A new Mail.app message will open and the contents of the webpage will be copied to the message and it will be sent in its entirety. -
Sending chinese HTML with javamail - is there no definitive answer ?
I'm using the following code to send a HTML and text e-mail
(text for people with HTML-challenged email clients). I sent
2 emails to 2 email addresses which reside on the same server
- eg. [email protected] and [email protected] - and read the
emails with the same e-mail client (Eudora) on the same PC.
The HTML and Chinese displays perfectly when it's sent to one
of the email addresses ([email protected]) but the HTML and
Chinese are always corrupt when I send them to the other.
This is a repeatable error and it has me completely stumped.
// Example Initial values (drawn from a database) :
String smtpHost = "mail.mydomain.com";
String sender = "[email protected]";
String subject = "Give me strength.... ";
InternetAddress sender = new InternetAddress("[email protected]");
InternetAddress receiver = new InternetAddress("[email protected]");
String txtMsg = "a long text message blah...";
String htmlMsg = "<h1>Wooo</h1><img src='http://mydomain.com/blink.gif'>";
String language = "zh-tw" // can also be "en-us" or "zh-cn"
// CREATE MAIL MESSAGE & HEADERS
Properties props = System.getProperties();
props.put("mail.smtp.host", smtpHost);
Session session = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(session);
msg.setFrom(sender);
msg.addRecipient(Message.RecipientType.TO, receiver);
msg.setSubject(subject);
msg.setSentDate(new Date());
msg.setHeader("Mime-Version" , "1.0" );
msg.setHeader("Content-Transfer-Encoding", "quoted-printable");
// MESSAGE BODY - TEXT & HTML
MimeMultipart mimeAllContent = new MimeMultipart("alternative");
MimeBodyPart mimeText = new MimeBodyPart();
MimeBodyPart mimeHtml = new MimeBodyPart();
mimeText.setText(textMsg);
mimeText.setHeader("Mime-Version" , "1.0" );
mimeText.setHeader("Content-Type" , "text/plain");
mimeText.addHeader("Content-Type", "charset=UTF-8");
if (!language.equals("")) {
mimeText.setHeader("Content-Language", language);
mimeText.setHeader("Content-Transfer-Encoding", "quoted-printable");
mimeHtml.setContent(htmlMsg, "text/html");
mimeHtml.setHeader("Mime-Version" , "1.0" );
mimeHtml.setHeader("Content-Type" , "text/html");
mimeHtml.addHeader("Content-Type", "charset=UTF-8");
if (!language.equals("")) {
mimeHtml.setHeader("Content-Language", language);
mimeHtml.setHeader("Content-Transfer-Encoding", "quoted-printable");
mimeAllContent.addBodyPart(mimeText);
mimeAllContent.addBodyPart(mimeHtml);
msg.setContent(mimeAllContent);
msg.setHeader("Content-Type" , mimeAllContent.getContentType());
// SEND THE MESSAGE
msg.saveChanges();
Transport.send(msg);
return true;
Let me repeat - Using the code below, a HTML & Text ("Alternative"
MimeMultiPart) message is sent, and arrives at the recipient's
mailbox. When it is sent to one user ([email protected]), it never
renders properly. When it is sent to another ([email protected]), it's
OK. The destination server, email client, PC are the same in both
cases and the only variable is the recipient's email address.
How can this be ?
I think I've gone overboard by setting the Content-Transfer-Encoding
for both the HTML and Text MimeParts as well as the actual Message.
Could somebody please confirm which parts I should set the Content-
-Language, Content-Transfer-Encoding and Content-Type b/c I'm
going in circles at the moment.
Thanks indeed, to anybody who has experience sending doublebyte
with Javamail and can help me clear this up once and for all.
I find it incredible that after 3 years, there is still no
definitive answer to accomplishing this, and it remains an
elusive black art.
Regards,
chas
ps. The data being sent is in MySQL not that that matters at all.Try adding code to validate submitted email addresses before they go into your database.
String emailAddress = (from where ever)
if(emailAddress != null) emailAddress = emailAddress.trim();
if(emailAddress == null) // skip this address
// I also check for a list of illegal internet email address characters, as I think the email addresses allowed by Javamail are too lenient. -
Sending an HTML email with Automator
I am trying to send a HTML postcard that I created to a list of 200 friends for a golf tournament. I would like to use Automator to send the emails to each user individually and not to the entire group at once.
So far I found one Automator action that will create an email message from a Safari page but my trouble is entering the addresses from my address book group for all 200 emails.
Could someone help me with a workflow?
Thanks in advance,
AdamTry this
<%@ page import="sun.net.smtp.SmtpClient,java.io.PrintStream" %>
<%
try{
String host = "IP"; //this is u r IP adress
String from = "[email protected]"; //mail adress of sender
String to = "[email protected]"; //mail address whom to
SmtpClient smtp = new SmtpClient(host);
smtp.from(from);
smtp.to(to);
PrintStream out1 = smtp.startMessage();
out1.println("To: " + to);
out1.println("Subject: Hello peter ");
out1.println();
out1.println("Hi Peter How r u doing ");
out1.flush();
out1.close();
smtp.closeServer();
catch(Exception e)
out.println(e+e.getMessage());
%> -
Send local html files to Browser
I have a Servlet program which can send any HTML files located on the computer which Tomcat is running to client browser. The HTML files are not necessarily in Tomcat's "webapps" folder. My method is quite simple. Read the content of the local HTML file and write it out through HttpServletResponse object. But there is problem that if the HTML file includes images, the images don't appear in client browser. Is there a way to send those images to client browse as well? Thanks in advance.
Well, this is just an idea, but:
You would probably have to create a new Servlet, that will identify the image type, set the correct content type (response.setContentType("image/gif") for example). It would have to get a binary InputStream to the image and copy the input to the output stream in the response(use the getOutputStream and not getWriter...)
In your HTML writing servlet you would have to scan each line for an <img ... > tag parse out the source and replace it with the image servlet.
Locating the image may be problematic if it is not given in absolute "file://" url. You may need to scan for a <base> tag in the HTML as well, or use the HTML page's directory for the path in which to find the image... but it could come in more complicated then that depending on how complicated the HTML was written (ie, for a server with multiple hosts, or with aliased paths...)
Or, you might be able to write a filter that looks for images(*.gif *.jpg) and sends the request to your image servlet.... -
How do i send an html page in java mail
hi everyone, i have an problem while sending html page in my java mail application.Actually it's sending the html page correctly but the thing is it doesn't display the gif files . why so ? can anyone help me. i think its b'coz of the path problem.
My requirement is like this :
I would like to send an html page to some [email protected] from my local system . for that i have written one mail application which will build an html page which is also having some gif files. And these gif files are located in my local system. when i sent to some xyz user it's not displaying the gif files . How should i give the path for that gif files. pls help me regarding this. This is Urgent.
Thanx in advance.
by
jjjavachi , here with i have attached my program which will work fine . What u have to do is u have to specify ur smtp host address. from address and to address. And if u want to embedd the gif file u have to specify the gif file name. It will work only in outlook and hotmail. if u have anyother doubt let me know.
import java.io.*;
import java.util.Properties;
import java.util.Date;
import javax.mail.*;
import javax.activation.*;
import javax.mail.internet.*;
import java.sql.*;
import java.text.*;
* @author Jeevan
public class EmbeddingGif {
StringBuffer sb = new StringBuffer();
String line;
public static void main(String[] argv) {
new EmbeddingGif (argv);
public EmbeddingGif (String[] argv) {
String to, subject = null, from = "[email protected]",
cc = null, bcc = null, url = null;
// String mailhost = null;
String mailhost = "10.1.0.106"; // SMTP host address
String mailer = "SendHtmlMail";
String protocol = "imap", host = null, user = "jeevan", password = "jeevan";
String record = "g:/rbs/web-inf/classes/emailstore"; // name of folder in which to record mail
boolean debug = false;
BufferedReader in = null;
int optind;
for (optind = 0; optind < argv.length; optind++) {
if (argv[optind].equals("-T")) {
protocol = argv[++optind];
} else if (argv[optind].equals("-H")) {
host = argv[++optind];
} else if (argv[optind].equals("-U")) {
user = argv[++optind];
} else if (argv[optind].equals("-P")) {
password = argv[++optind];
} else if (argv[optind].equals("-M")) {
mailhost = argv[++optind];
} else if (argv[optind].equals("-f")) {
record = argv[++optind];
} else if (argv[optind].equals("-s")) {
subject = argv[++optind];
} else if (argv[optind].equals("-o")) { // originator
from = argv[++optind];
} else if (argv[optind].equals("-c")) {
cc = argv[++optind];
} else if (argv[optind].equals("-b")) {
bcc = argv[++optind];
} else if (argv[optind].equals("-L")) {
url = argv[++optind];
} else if (argv[optind].equals("-d")) {
debug = true;
} else if (argv[optind].equals("--")) {
optind++;
break;
} else if (argv[optind].startsWith("-")) {
System.out.println(
"Usage: SendHtmlMail [[-L store-url] | [-T prot] [-H host] [-U user] [-P passwd]]");
System.out.println(
"\t[-s subject] [-o from-address] [-c cc-addresses] [-b bcc-addresses]");
System.out.println(
"\t[-f record-mailbox] [-M transport-host] [-d] [address]");
System.exit(1);
} else {
break;
try {
if (optind < argv.length) {
// XXX - concatenate all remaining arguments
to = argv[optind];
System.out.println("To: " + to);
} else {
System.out.print("To: ");
System.out.flush();
// to = in.readLine();
to = "[email protected]";
if (subject == null) {
System.out.print("Subject: ");
System.out.flush();
// subject = in.readLine();
subject = "New Bill @ " + new Date ();
} else {
System.out.println("Subject: " + subject);
Properties props = System.getProperties();
// XXX - could use Session.getTransport() and Transport.connect()
// XXX - assume we're using SMTP
System.out.println("mailhost :"+mailhost);
System.out.println("from :"+from);
System.out.println("to :"+to);
System.out.println("cc :"+cc);
System.out.println("subject :"+subject);
System.out.println("bcc :"+bcc);
System.out.println("url :"+url);
if (mailhost != null)
props.put("mail.smtp.host", mailhost);
// Get a Session object
Session session = Session.getDefaultInstance (props, null);
if (debug)
session.setDebug (true);
// construct the message
Message msg = new MimeMessage(session);
if (from != null)
msg.setFrom(new InternetAddress(from));
else
msg.setFrom();
msg.setRecipients(Message.RecipientType.TO,
InternetAddress.parse(to, false));
if (cc != null)
msg.setRecipients(Message.RecipientType.CC,
InternetAddress.parse(cc, false));
if (bcc != null)
msg.setRecipients(Message.RecipientType.BCC,
InternetAddress.parse(bcc, false));
msg.setSubject(subject);
collect(in, msg);
// msg.setHeader("X-Mailer", mailer);
// msg.setSentDate(new Date());
// send the thing off
// Transport.send(msg);
// System.out.println("\nMail was sent successfully.");
} catch (Exception e) {
e.printStackTrace();
public void collect(BufferedReader in, Message msg) throws MessagingException, IOException {
BodyPart bp1=new MimeBodyPart();
String html="<H1>Hello from Jeevan</H1>";
html=html+"<img src=cid:mickey>";
bp1.setContent(html,"text/html");
MimeMultipart mp=new MimeMultipart("related");
mp.setSubType("related");
mp.addBodyPart(bp1);
BodyPart bp2=new MimeBodyPart();
DataSource source=new FileDataSource("fss.gif");
bp2.setDataHandler(new DataHandler(source));
bp2.setHeader("discrete-type","image");
bp2.setHeader("Content-ID","mickey");
mp.addBodyPart(bp2);
msg.setContent(mp);
Transport.send(msg);
System.out.println("\nMail was sent successfully.");
// msg.setDataHandler(new DataHandler( new ByteArrayDataSource(sb.toString(), "text/html"))); -
Sending Unicode HTML email from Oracle
Dear All,
How we can send the HTML email from Oracle in Unicode format (I am using Arabic Language, to be specific). So far I have tried the following solutions (using utl_smpt) without any success (either i see junk characters in the email or see question marks). Would you please help me in solving this?
Options Tried*
Option 1
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE p_send_mail_test (
2 sender IN VARCHAR2,
3 recipient IN VARCHAR2,
4 subj IN VARCHAR2,
5 message IN VARCHAR2)
6 IS
7 mailhost VARCHAR2(30) := '<smtp Server>';
8 c utl_smtp.connection;
9 PROCEDURE send_header( name IN VARCHAR2, header IN VARCHAR2) AS
10 BEGIN
11 utl_smtp.write_data(c, name || ': ' || header || utl_tcp.CRLF);
12 END;
13 BEGIN
14 c := utl_smtp.open_connection(mailhost,25);
15 utl_smtp.helo(c, mailhost);
16 utl_smtp.mail(c, sender);
17 utl_smtp.rcpt(c, recipient);
18 utl_smtp.open_data(c);
19 send_header('From', sender);
20 send_header('To', recipient);
21 -- If you need to send mail to more than one receipient, uncomment the
22 -- following line(s) as appropriate. Please don't forget the ","
23 -- in the "To" line before the next receipient's email id. You can't
24 -- use a comma separated list in the receipient parameter.
25 -- For variable number of "To"'s and "Cc"'s have multiple calls to
26 -- "send_header" function inside a cursor for loop.
27 -- Similar comments apply for "Cc" too.
28 -- send_header('To', ',<email@domain>');
29 send_header('Cc', ',<email@domain>');
30 send_header('Subject', subj);
31 utl_smtp.write_data(c, utl_tcp.CRLF || message);
32 utl_smtp.close_data(c);
33 utl_smtp.quit(c);
34 EXCEPTION
35 WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
36 utl_smtp.quit(c);
37 raise_application_error(-20000,
38 'Failed to send mail due to the following error: ' || sqlerrm);
39* END;
SQL>
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 p_send_mail_test('<email@domain>','<email@domain>','Hello',email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result_
<div align="right"><font size="4"><b>????? Riaz ???????</b>
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
.???? ???? ????? ???????? </font></div>
[Question marks along with all tags; this OTN page is converting that to HTML output]
Option2
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure html_email(
2 p_to in varchar2,
3 p_from in varchar2,
4 p_subject in varchar2,
5 p_text in varchar2 default null,
6 p_html in varchar2 default null
7 )
8 is
9 l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
10 l_connection utl_smtp.connection;
11 l_body_html clob := empty_clob; --This LOB will be the email message
12 l_offset number;
13 l_ammount number;
14 l_temp varchar2(32767) default null;
15 l_smtp_hostname varchar2(50) := '<smtp Server>';
16 begin
17 l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
18 utl_smtp.helo( l_connection, l_smtp_hostname );
19 utl_smtp.mail( l_connection, p_from );
20 utl_smtp.rcpt( l_connection, p_to );
21 l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
22 l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
23 l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
24 l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
25 l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
26 l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
27 chr(34) || l_boundary || chr(34) || chr(13) ||
28 chr(10);
29 ----------------------------------------------------
30 -- Write the headers
31 dbms_lob.createtemporary( l_body_html, false, 10 );
32 dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
33 ----------------------------------------------------
34 -- Write the text boundary
35 l_offset := dbms_lob.getlength(l_body_html) + 1;
36 l_temp := '--' || l_boundary || chr(13)||chr(10);
37 l_temp := l_temp || 'content-type: text/plain;charset=utf-8' ||
38 chr(13) || chr(10) || chr(13) || chr(10);
39 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
40 ----------------------------------------------------
41 -- Write the plain text portion of the email
42 l_offset := dbms_lob.getlength(l_body_html) + 1;
43 dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
44 ----------------------------------------------------
45 -- Write the HTML boundary
46 l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
47 chr(13) || chr(10);
48 l_temp := l_temp || 'content-type: text/html;charset=utf-8' ||
49 chr(13) || chr(10) || chr(13) || chr(10);
50 l_offset := dbms_lob.getlength(l_body_html) + 1;
51 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
52 ----------------------------------------------------
53 -- Write the HTML portion of the message
54 l_offset := dbms_lob.getlength(l_body_html) + 1;
55 dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
56 ----------------------------------------------------
57 -- Write the final html boundary
58 l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
59 l_offset := dbms_lob.getlength(l_body_html) + 1;
60 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
61 ----------------------------------------------------
62 -- Send the email in 1900 byte chunks to UTL_SMTP
63 l_offset := 1;
64 l_ammount := 1900;
65 utl_smtp.open_data(l_connection);
66 while l_offset < dbms_lob.getlength(l_body_html) loop
67 utl_smtp.write_data(l_connection,
68 dbms_lob.substr(l_body_html,l_ammount,l_offset));
69 l_offset := l_offset + l_ammount ;
70 l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
71 end loop;
72 utl_smtp.close_data(l_connection);
73 utl_smtp.quit( l_connection );
74 dbms_lob.freetemporary(l_body_html);
75* end;
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 html_email(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
????? Riaz ???????
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
Option3
SQL> ed
Wrote file afiedt.buf
1 create or replace procedure p_html_email_riaz(
2 p_to in varchar2,
3 p_from in varchar2,
4 p_subject in varchar2,
5 p_text in varchar2 default null,
6 p_html in varchar2 default null
7 )
8 is
9 l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
10 l_connection utl_smtp.connection;
11 l_body_html clob := empty_clob; --This LOB will be the email message
12 l_offset number;
13 l_ammount number;
14 l_temp varchar2(32767) default null;
15 l_smtp_hostname varchar2(50) := '<smtp Server>';
16 begin
17 l_connection := utl_smtp.open_connection( l_smtp_hostname, 25);
18 utl_smtp.helo( l_connection, l_smtp_hostname );
19 utl_smtp.mail( l_connection, p_from );
20 utl_smtp.rcpt( l_connection, p_to );
21 l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
22 l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
23 l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
24 l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
25 l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
26 l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
27 chr(34) || l_boundary || chr(34) || chr(13) ||
28 chr(10);
29 ----------------------------------------------------
30 -- Write the headers
31 dbms_lob.createtemporary( l_body_html, false, 10 );
32 dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
33 ----------------------------------------------------
34 -- Write the text boundary
35 l_offset := dbms_lob.getlength(l_body_html) + 1;
36 l_temp := '--' || l_boundary || chr(13)||chr(10);
37 l_temp := l_temp || 'content-type: text/plain; charset=UTF-8' ||
38 chr(13) || chr(10) || chr(13) || chr(10);
39 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
40 ----------------------------------------------------
41 -- Write the plain text portion of the email
42 /**
43 l_offset := dbms_lob.getlength(l_body_html) + 1;
44 dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
45 **/
46 ----------------------------------------------------
47 -- Write the HTML boundary
48 l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
49 chr(13) || chr(10);
50 l_temp := l_temp || 'content-type: text/html;' ||
51 chr(13) || chr(10) || chr(13) || chr(10);
52 l_offset := dbms_lob.getlength(l_body_html) + 1;
53 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
54 ----------------------------------------------------
55 -- Write the HTML portion of the message
56 l_offset := dbms_lob.getlength(l_body_html) + 1;
57 dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
58 ----------------------------------------------------
59 -- Write the final html boundary
60 l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
61 l_offset := dbms_lob.getlength(l_body_html) + 1;
62 dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
63 ----------------------------------------------------
64 -- Send the email in 1900 byte chunks to UTL_SMTP
65 l_offset := 1;
66 l_ammount := 1900;
67 utl_smtp.open_data(l_connection);
68 while l_offset < dbms_lob.getlength(l_body_html) loop
69 utl_smtp.write_raw_data(l_connection,
70 utl_raw.cast_to_raw(
71 dbms_lob.substr(l_body_html,l_ammount,l_offset ) ) );
72 l_offset := l_offset + l_ammount ;
73 l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
74 end loop;
75 utl_smtp.close_data(l_connection);
76 utl_smtp.quit( l_connection );
77 dbms_lob.freetemporary(l_body_html);
78* end;
SQL>
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 p_html_email_riaz(p_to=>'<email@domain>',p_from=>'<email@domain>',p_subject=>'Hello',p_text=>'Hi', p_html=>email_text);
8* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
GaSmO Riaz GacMJQc
mQLl GaJ_Qc HGaZac Cd GaZ^O GaNGU H_c SmdJem HJGQmN 12-07-2011
. fZame mQL\l GaJ_\Qc HE]GOI EOGQI GacfGQO GaHTQmI ]m MGa ZOc Q[HJ_c HJLOmO GaZ^O NaGa cOI C^UeG CSHfZmd cd Gamfc fPa_ aaCecmI Ga^Ufl
.fa_c LRma GaT_Q fGaJ^OmQ
*Option4*
[code]
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE send_email_html_test(
2 pi_from IN Varchar,
3 pi_to IN VARCHAR,
4 pi_cc IN Varchar,
5 pi_subj IN VARCHAR,
6 pi_msg CLOB
7 )
8 IS
9 conn utl_smtp.connection;
10 lv_mailhost varchar2(1000);
11 lv_port number;
12 BEGIN
13 lv_mailhost := '<smtp Server>';
14 lv_port := 25;
15 conn := utl_smtp.open_connection(lv_mailhost, lv_port);
16 utl_smtp.helo(conn, lv_mailhost);
17 utl_smtp.mail(conn, pi_from);
18 utl_smtp.rcpt(conn, pi_to);
19 IF pi_cc is not null THEN
20 utl_smtp.rcpt(conn, pi_cc);
21 END IF;
22 utl_smtp.open_data(conn);
23 utl_smtp.write_data(conn, 'MIME-version: 1.0' || utl_tcp.CRLF);
24 utl_smtp.write_data(conn, 'Content-Type: text/html; charset=iso-8859-6' ||
25 utl_tcp.CRLF);
26 utl_smtp.write_data(conn, 'Content-Transfer-Encoding: 8bit' ||
27 utl_tcp.CRLF);
28 utl_smtp.write_data(conn, 'From:' ||pi_from || utl_tcp.CRLF);
29 utl_smtp.write_data(conn, 'To:' ||pi_to || utl_tcp.CRLF);
30 utl_smtp.write_data(conn, 'Cc:' ||pi_cc || utl_tcp.CRLF);
31 utl_smtp.write_data(conn, 'Reply-To:' ||pi_from || utl_tcp.CRLF);
32 utl_smtp.write_data(conn, 'Subject:' ||pi_subj|| utl_tcp.CRLF);
33 utl_smtp.write_data(conn, utl_tcp.crlf);
34 utl_smtp.write_raw_data(conn, utl_raw.cast_to_raw(pi_msg));
35 utl_smtp.close_data(conn);
36 utl_smtp.quit(conn);
37 EXCEPTION WHEN others THEN
38 dbms_output.put_line(sqlerrm);
39* END;
40 /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='
<div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b>
يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'
. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى
.ولكم جزيل الشكر والتقدير </font></div>';
7 send_email_html_test('<email@domain>',
8 '<email@domain>',
9 '<email@domain>',
10 'Hello',email_text);
11* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
Riaz افكحترك
ٍرجٌ افترك بافغفك أل افغد افخاص بك سٍلتمٍ بتارٍخ 12-07-2011
. نغفٍم ٍرجٌ افترك بإادة إدارة افكنارد افبشرٍة ٍ حاف غدك ربتك بتجدٍد افغد خفاف كدة أصما أسبنغٍل كل افٍنك نذف ففأمكٍة افصنٌ
.نفك جزٍف افشر نافتدٍر
Option5
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE send_mail_test1 (p_to IN VARCHAR2,
2 p_from IN VARCHAR2,
3 p_subject IN VARCHAR2,
4 p_text_msg IN VARCHAR2 DEFAULT NULL,
5 p_html_msg IN VARCHAR2 DEFAULT NULL,
6 p_smtp_host IN VARCHAR2,
7 p_smtp_port IN NUMBER DEFAULT 25)
8 AS
9 l_mail_conn UTL_SMTP.connection;
10 l_boundary VARCHAR2(50) := '----=*#abc1234321cba#*=';
11 BEGIN
12 l_mail_conn := UTL_SMTP.open_connection(p_smtp_host, p_smtp_port);
13 UTL_SMTP.helo(l_mail_conn, p_smtp_host);
14 UTL_SMTP.mail(l_mail_conn, p_from);
15 UTL_SMTP.rcpt(l_mail_conn, p_to);
16 UTL_SMTP.open_data(l_mail_conn);
17 UTL_SMTP.write_data(l_mail_conn, 'Date: ' || TO_CHAR(SYSDATE, 'DD-MON-YYYY HH24:MI:SS') || UTL_TCP.crlf);
18 UTL_SMTP.write_data(l_mail_conn, 'To: ' || p_to || UTL_TCP.crlf);
19 UTL_SMTP.write_data(l_mail_conn, 'From: ' || p_from || UTL_TCP.crlf);
20 UTL_SMTP.write_data(l_mail_conn, 'Subject: ' || p_subject || UTL_TCP.crlf);
21 UTL_SMTP.write_data(l_mail_conn, 'Reply-To: ' || p_from || UTL_TCP.crlf);
22 UTL_SMTP.write_data(l_mail_conn, 'MIME-Version: 1.0' || UTL_TCP.crlf);
23 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: multipart/alternative; boundary="' || l_boundary || '"' || UTL_TCP.crlf || UTL_TCP.crlf);
24 IF p_text_msg IS NOT NULL THEN
25 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
26 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/plain; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
27 UTL_SMTP.write_data(l_mail_conn, p_text_msg);
28 UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
29 END IF;
30 IF p_html_msg IS NOT NULL THEN
31 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || UTL_TCP.crlf);
32 UTL_SMTP.write_data(l_mail_conn, 'Content-Type: text/html; charset="utf-8"' || UTL_TCP.crlf || UTL_TCP.crlf);
33 UTL_SMTP.write_data(l_mail_conn, p_html_msg);
34 UTL_SMTP.write_data(l_mail_conn, UTL_TCP.crlf || UTL_TCP.crlf);
35 END IF;
36 UTL_SMTP.write_data(l_mail_conn, '--' || l_boundary || '--' || UTL_TCP.crlf);
37 UTL_SMTP.close_data(l_mail_conn);
38 UTL_SMTP.quit(l_mail_conn);
39* END;
SQL> /
Procedure created.
SQL> ed
Wrote file afiedt.buf
1 declare
2 email_text varchar2(2000);
3 contract_end_date_v date := sysdate;
4 name_v varchar2(200) := 'Riaz';
5 begin
6 email_text :='<br/><div align="right"><font size="4"><b>السيد '||name_v||' المحترم</b><br/><br/> يرجى التكرم بالعلم أن العقد الخاص بكم سينتهي بتاريخ ' || to_char(contract_end_date_v,'dd-mm-yyyy')||'<br/>. وعليه يرجـى التكـرم بإفادة إدارة الموارد البشرية في حال عدم رغبتكم بتجديد العقد خلال مدة أقصها أسبوعين من اليوم وذلك للأهمية القصوى <br/>.ولكم جزيل الشكر والتقدير </font></div>';
7 send_mail_test1('<email@domain>',
8 '<email@domain>',
9 'Hello',
10 'msg',
11 email_text,
12 '<smtp Server>',
13 25);
14* end;
SQL> /
PL/SQL procedure successfully completed.
Result*
????? Riaz ???????
???? ?????? ?????? ?? ????? ????? ??? ?????? ?????? 12-07-2011
.???? ???? ????? ????????I worked with Oracle support and was able to find solution. The helping document ids were: 752309.1 & 404389.1
-
Background html images sending an HTML mail
Hello:
I'm sending a mail with html format, and i need the images are embebed in the mail.
I send its like an Attachment, and reference its whith cid:"..." and it works fine while the image isn�t the background, but I need send an html document with an image in background!!!
Somebody can help me? Its Urgent!
Any idea its appreciated. Thanks.Yes, there is the code:
Properties props = System.getProperties();
//props.put("mail.smtp.host","servidor2000.galia.e-netfinger.com");
props.put("mail.smtp.host",varParametros.varCorreoSaliente);
Session session = Session.getDefaultInstance(props);
Message message = new MimeMessage(session);
InternetAddress from = new InternetAddress(varParametros.varFrom);
InternetAddress to[] = InternetAddress.parse(varParametros.varTo);
message.setFrom(from);
message.setRecipients(Message.RecipientType.TO,to);
message.setSubject(varParametros.varSubject);
Multipart multipart1=new MimeMultipart("alternative");
BodyPart htmlpart=new MimeBodyPart();
htmlpart.setContent(varCorreo,varContentType); //varContentType=text/html
MimeMultipart multipart = new MimeMultipart("related");
multipart.addBodyPart(htmlpart);
for (int i=0;i<varCCorreo.varFicheroAdjunto.size();i++){
BodyPart messageBodyPart = new MimeBodyPart();
CFicheroAdjunto varCFAdjunto=((CFicheroAdjunto)(varCCorreo.varFicheroAdjunto.elementAt(i)));
DataSource source=null;
if (varCFAdjunto.varNombre.toLowerCase().endsWith("jpg") ){
source=new ByteArrayDataSource(varCFAdjunto.varFile,"image/jpeg");
}else if (varCFAdjunto.varNombre.toLowerCase().endsWith("gif")){
source=new ByteArrayDataSource(varCFAdjunto.varFile,"image/gif");
}else{
source=new ByteArrayDataSource(varCFAdjunto.varFile,"application/xxx" );
messageBodyPart.setDisposition(Part.ATTACHMENT);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(((CFicheroAdjunto)(varCCorreo.varFicheroAdjunto.elementAt(i))).varNombre);
messageBodyPart.setHeader("Content-ID","<"+varCFAdjunto.varNombre+">");
multipart.addBodyPart(messageBodyPart);
}//end for
// Put parts in message
MimeBodyPart mbp = new MimeBodyPart();
mbp.setContent(multipart);
multipart1.addBodyPart(mbp);
message.setContent(multipart1);
Transport.send(message);
And in my html code I get:
<body background="cid:name.jpg">
Please, I need help!! -
How do i send an html file exported from muse as email blast with images and live links?
My question it:
How do i send an html file exported from muse as email blast with images and live links?
I have designed a "website" in adobe muse and exported it as an html file. I am not sure how to send my .html file in an email!
Best,
NicoleUnfortunately, the answer is, you don't. The requirements for HTML displayed in an e-mail reader are very different than those for HTML displayed in a browser. The output of Muse won't work as an HTML e-mail. You could upload the Muse site as a website and provide a link to it in an e-mail, but the HTML generated by Muse is not suitable for direct display by an e-mail program.
-
How do I send an html file?
How would I send an html document so that it opens with all its graphics inside mail. I dont want to send it as an attachment just as a newsletter type of mailing. Any ideas??
I had the same problem. In Safari if you press apple & i it opens up a new mail message and puts the web page in it with all graphic and buttons working. So if you can host your newletter as a web page then press apple i you'll be able to send it as a html message.
-
Sample Java Code to send an HTML mail with embeded image
Hello,
Please can I get a sample Java code on sending an HTML mail with embeded image.
The HTML message and relevant input parameters withhbe supplied from a PL/SQL that will call the class , the class will embed the image and send the mail to the recepient.tev wrote:
Please can I get a sample Java codeNo. This is a forum, not a code mill.
Recommended reading: How to ask questions the smart way
db -
How do i send a html email from office outlook web access?
how do i send a html email from office outlook web access?
glenholmes,
You've come to the right place for help. Sorry to hear that you have had hard time with your Gmail app lately. What steps have you tried to get this to work? We want to ensure that you are able to start sending those messages right away.
ErinW_VZW
Follow us on Twitter @VZWSupport
Maybe you are looking for
-
Declare object type inside the package
Hi, How can I declare an object type inside the package? CREATE TYPE TempObj AS OBJECT ( user_id number, text varchar2(4000), date_created DATE This will not work if placed inside this: CREATE OR REPLACE PACKAGE SAMPLE_PKG IS ---declaration goes here
-
Populatin a JList with elements from a DB (access here)
last year i was able to populate a JList with data from a database however this year something doesnt work this is last year public String[] getOnderwerpen() System.out.println(theConnection==null?" connection null ":" connection niet null "); String
-
Hierarchical Cost planning in CJ40 not updating in CNS41
Hello Experts, When i am planning cost using cj40 than checking report cns41 so this is not showing cost planned via cj40. what will be reason of not showing this cost plan. Please guide. thanks Sunil
-
Issue with the FR translation for toolbar buttons and title bar
Hi All, In a report program I have a toolbar with some custom buttons and icons (GI Status) and I have a title bar (GUI Title) with the report heading. I have FR translations defined for them in SE63, but they are not actually displayed when I run re
-
Hi all, I'm using program RFKORD50 to print customer invoices. For this I have made a copy of the form F140_DOCU_EXC_02 (Customer Invoice), and added this to the form set in RFKORD50. I would like to add some additional information in this Z-form, da