how send the pic&TEXT in email using PLSQL [message #460631] |
Sun, 13 June 2010 11:08 |
aljabali
Messages: 53 Registered: July 2008
|
Member |
|
|
hii
how are you ...
I am create procedure send the message in form bulider10g to
Internet email and the procedure is work .
but now I want to modify this procedure , I want to add picture
of my country ( logo ) and the original message .
why cant display the image in my email ??????
this code of image
<p align="center"><img border="0" src="logo.gif" width="20" height="20"></p>
I Think the problem of this code because 'Content-type: text/html' not image ?????!!!!!!!
utl_smtp.data(v_Mail_Conn, 'MIME-Version: 1.0' ||CHR(13)|| CHR(10)||'Content-type: text/html' || CHR(13)||CHR(10)||mesg);
procedure
EMAIL_SEN VARCHAR2(250);
EMAIL_REC VARCHAR2(250);
DESC_EN VARCHAR2(250);
UB_SEQ NUMBER(10);
BEGIN
DECLARE
v_From VARCHAR2(80) :=admin@yahoo.com ;
v_Recipient VARCHAR2(80) := client@yahoo.com;
v_Subject VARCHAR2(80) := 'Hello';
v_Mail_Host VARCHAR2(100) :='mail.mak.com';
v_Mail_Conn utl_smtp.Connection;
crlf VARCHAR2(2) := chr(13)||chr(10);
mesg VARCHAR2( 4000 );
mesg_body varchar2(10000)
/* Variable for storing HTML code */
:= '<html dir="ltr">
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Delmon University for Science an</title>
</head>
<body>
<table cellspacing="0" cellpadding="0" width="100%">
<tr align="LEFT" valign="BASELINE">
<td width="100%" valign="middle"><h1><a href="http://www.mycompany.com"><font color="#00008B"><b>My company</b></font></h1>
</td>
</table>
<p align="center"><img border="0" src="logo.gif" width="20" height="20"></p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><font face="Calibri" size="5">Thank you
</font></p>
<p align="center"><font face="Calibri" size="5">Your item : ' ||desc_en||'
Code : ' ||UB_SEQ||'</font></p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p align="center"> </p>
</blockquote>
<p align="center"><font face="Calibri" size="5">Has been
transfer successfully to your account</font></p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</body>
</html> ';
BEGIN
--MESSAGE(6);
--MESSAGE(6);
--message(:sender||' X '||:recipient||' X '||:subject||' X '||:smtp||' X '||:message,ACKNOWLEDGE);
v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
utl_smtp.Mail(v_Mail_Conn, v_From);
utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
/* Making Message buffer */
mesg:=
'Date: '||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' )|| crlf ||
'From:'||v_From|| crlf ||
'Subject: '||'My company' || crlf ||
'To: '||v_Recipient || crlf ||
'' || crlf ||mesg_body||'';
utl_smtp.data(v_Mail_Conn, 'MIME-Version: 1.0' ||CHR(13)|| CHR(10)||'Content-type: text/html' || CHR(13)||CHR(10)||mesg);
utl_smtp.Quit(v_mail_conn);
EXCEPTION
WHEN utl_smtp.Transient_Error OR utl_smtp.Permanent_Error then
message(/*raise_application_error*/ 'Unable to send mail: '||sqlerrm,ACKNOWLEDGE);
--raise_application_error(-20000, 'Unable to send mail: '||sqlerrm);
END ;
can you help me ..............
END;
|
|
|
|
Re: how send the pic&TEXT in email using PLSQL [message #463948 is a reply to message #460660] |
Mon, 05 July 2010 06:36 |
|
djmartin
Messages: 10181 Registered: March 2005 Location: Surges Bay TAS Australia
|
Senior Member Account Moderator |
|
|
Sorry that I have been so long in replying. Have you solved your problem?
At another place I think that we concatenated the contents of the graphic into the html stream as a series of ASCI or hexadeciaml characters.
David
|
|
|