utl_smtp and japanese characters ?
Hi all, (B (Bi have written a small procedure to send e-mail from (Bmy oracle database [oracle 9.2.0.3/win2k]. (B (Bmessage := 'Date: ' || TO_CHAR( SYSDATE, 'DD-Mon- HH24:MI:SS' ) || (Butl_tcp.CRLF; (Bmessage := message || 'From: ' || sender || utl_tcp.CRLF; (Bmessage := message || 'Subject: ' || subject || utl_tcp.CRLF; (Bmessage := message || 'To: ' || recipient || utl_tcp.CRLF; (Bmessage := message || 'Mime-Version: 1.0' || utl_tcp.CRLF; (Bmessage := message || 'Content-Type: text/plain; (Bcharset="ISO-2022-JP"'||utl_tcp.CRLF; (Bmessage := message || '$BI=NN0hL>(B' || chr(9) || '$B6u$-NN0h(B (MB)' || (Butl_tcp.CRLF; # JAPANESE CHARACTERS ARE HERE (Bmail_conn :=utl_smtp.open_connection(mailhost,25); (Butl_smtp.helo(mail_conn,mailhost); (Butl_smtp.mail(mail_conn,sender); (Butl_smtp.rcpt(mail_conn,recipient); (Butl_smtp.open_data(mail_conn); (Butl_smtp.write_data(mail_conn, message); (Butl_smtp.close_data(mail_conn); (Butl_smtp.quit(mail_conn); (B (Bthe japanese characters come out as ??? in the e-mail, (Bwhereas english characters work fine. (Bwhat's wrong with my code ? Can someone help me ? (B (BRegards, (BJp. (B (B-- (BPlease see the official ORACLE-L FAQ: http://www.orafaq.net (B-- (BAuthor: Prem Khanna J (B INET: [EMAIL PROTECTED] (B (BFat City Network Services-- 858-538-5051 http://www.fatcity.com (BSan Diego, California-- Mailing list and web hosting services (B- (BTo REMOVE yourself from this mailing list, send an E-Mail message (Bto: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in (Bthe message BODY, include a line containing: UNSUB ORACLE-L (B(or the name of mailing list you want to be removed from). You may (Balso send the HELP command for other information (like subscribing).
Re: utl_smtp error
From: Joan Hsieh <[EMAIL PROTECTED]> Thanks for explantion. I asked the smtp mail admin. He said The relays are running Exim-4.10. Is that help? What is it you're trying to mail from the database? Chris Berry [EMAIL PROTECTED] Systems Administrator JM Associates "Without change, something sleeps inside us, and seldom awakens. The sleeper must awaken." -- Duke Leto Atreides _ -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Chris Berry INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: utl_smtp error
Chris, Thanks for explantion. I asked the smtp mail admin. He said The relays are running Exim-4.10. Is that help? Joan Chris Berry wrote: > > >From: Joan Hsieh <[EMAIL PROTECTED]> > >Chris, > >you got me, what MTA stand for? > > Mail Transfer Agent, its the program that uses SMTP to send or recieve mail. > Examples: > > Sendmail > Courier > Postfix > Exim > qmail > MS Exchange > > Don't confuse this with an MUA (mail user agent) which allows you to compose > and read email without using telnet manually. Examples: > > Mutt > Pine > Mozilla > Outlook > > If you're getting smtp errors, perhaps your MTA is misconfigured, > unavailable, overloaded, etc. SMTP stands for Simple Mail Transfer > Protocol. > > Chris Berry > [EMAIL PROTECTED] > Systems Administrator > JM Associates > > "Without change, something sleeps inside us, and seldom awakens. The > sleeper must awaken." -- Duke Leto Atreides > > _ > Help STOP SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.net > -- > Author: Chris Berry > INET: [EMAIL PROTECTED] > > Fat City Network Services-- 858-538-5051 http://www.fatcity.com > San Diego, California-- Mailing list and web hosting services > - > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Joan Hsieh INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re[2]: utl_smtp error
Joan, MTA=Mail Transport Agent which is what routes and delivers mail usually using SMTP. On most Unix systems its some version of sendmail. Under windows it's often Exchange Server. This is different from the MUA=Mail User Agent which is what the user uses to manipulate his mail. The MUA usually communicates with the MTA with protocols such as POP, IMAP, and MAPI. On Unix that could be mail, mailx, elm, xmail, and such. Under Windows it's often Outlook but could be anything. -rje J> Chris, J> you got me, what MTA stand for? J> Joan J> Chris Berry wrote: >> >> >-Original Message- >> >Sent: Thursday, March 27, 2003 9:14 AM >> >To: Multiple recipients of list ORACLE-L >> >We have 3 databases on test server and one instance on production >> >server. 8.1.7.4 oracle; >> >None of them had those problem before. The email always working and had >> >been tested throughly. >> > Recently we got ORA-20001: 421 Service not available >> > ORA-06512: at "SYS.UTL_SMTP", line 83 >> > ORA-06512: at "SYS.UTL_SMTP", line 121 >> > ORA-06512: at line 5 >> > these errors. I noticed that some of ctxsys packages became invalid. >> >After I >> > recompiled all the objects, the errors are gone, it seems working. >> >However, after >> > 2 or 3 times success sent email, the errors showed up again. On >> >production >> > server, after I recompiled the packages, first time run successfully, >> >then >> > error out. >> > I am not sure why it start to error out? It is not consistent, >> >sometimes works and sometimes not; I checked all the related documents >> >regarding these errors. Nothing really matches our case. Does anyone can >> >point me where I should look into it? >> >> What MTA are you running? >> >> Chris Berry >> [EMAIL PROTECTED] >> Systems Administrator >> JM Associates >> >> "Without change, something sleeps inside us, and seldom awakens. The >> sleeper must awaken." -- Duke Leto Atreides >> >> _ >> Help STOP SPAM with the new MSN 8 and get 2 months FREE* >> http://join.msn.com/?page=features/junkmail >> >> -- >> Please see the official ORACLE-L FAQ: http://www.orafaq.net >> -- >> Author: Chris Berry >> INET: [EMAIL PROTECTED] >> >> Fat City Network Services-- 858-538-5051 http://www.fatcity.com >> San Diego, California-- Mailing list and web hosting services >> - >> To REMOVE yourself from this mailing list, send an E-Mail message >> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in >> the message BODY, include a line containing: UNSUB ORACLE-L >> (or the name of mailing list you want to be removed from). You may >> also send the HELP command for other information (like subscribing). J> -- J> Please see the official ORACLE-L FAQ: http://www.orafaq.net -rje -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Robert Eskridge INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: utl_smtp error
From: Joan Hsieh <[EMAIL PROTECTED]> Chris, you got me, what MTA stand for? Mail Transfer Agent, its the program that uses SMTP to send or recieve mail. Examples: Sendmail Courier Postfix Exim qmail MS Exchange Don't confuse this with an MUA (mail user agent) which allows you to compose and read email without using telnet manually. Examples: Mutt Pine Mozilla Outlook If you're getting smtp errors, perhaps your MTA is misconfigured, unavailable, overloaded, etc. SMTP stands for Simple Mail Transfer Protocol. Chris Berry [EMAIL PROTECTED] Systems Administrator JM Associates "Without change, something sleeps inside us, and seldom awakens. The sleeper must awaken." -- Duke Leto Atreides _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Chris Berry INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: utl_smtp error
Chris, you got me, what MTA stand for? Joan Chris Berry wrote: > > >-Original Message- > >Sent: Thursday, March 27, 2003 9:14 AM > >To: Multiple recipients of list ORACLE-L > >We have 3 databases on test server and one instance on production > >server. 8.1.7.4 oracle; > >None of them had those problem before. The email always working and had > >been tested throughly. > > Recently we got ORA-20001: 421 Service not available > > ORA-06512: at "SYS.UTL_SMTP", line 83 > > ORA-06512: at "SYS.UTL_SMTP", line 121 > > ORA-06512: at line 5 > > these errors. I noticed that some of ctxsys packages became invalid. > >After I > > recompiled all the objects, the errors are gone, it seems working. > >However, after > > 2 or 3 times success sent email, the errors showed up again. On > >production > > server, after I recompiled the packages, first time run successfully, > >then > > error out. > > I am not sure why it start to error out? It is not consistent, > >sometimes works and sometimes not; I checked all the related documents > >regarding these errors. Nothing really matches our case. Does anyone can > >point me where I should look into it? > > What MTA are you running? > > Chris Berry > [EMAIL PROTECTED] > Systems Administrator > JM Associates > > "Without change, something sleeps inside us, and seldom awakens. The > sleeper must awaken." -- Duke Leto Atreides > > _ > Help STOP SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.net > -- > Author: Chris Berry > INET: [EMAIL PROTECTED] > > Fat City Network Services-- 858-538-5051 http://www.fatcity.com > San Diego, California-- Mailing list and web hosting services > - > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Joan Hsieh INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: utl_smtp error
-Original Message- Sent: Thursday, March 27, 2003 9:14 AM To: Multiple recipients of list ORACLE-L We have 3 databases on test server and one instance on production server. 8.1.7.4 oracle; None of them had those problem before. The email always working and had been tested throughly. Recently we got ORA-20001: 421 Service not available ORA-06512: at "SYS.UTL_SMTP", line 83 ORA-06512: at "SYS.UTL_SMTP", line 121 ORA-06512: at line 5 these errors. I noticed that some of ctxsys packages became invalid. After I recompiled all the objects, the errors are gone, it seems working. However, after 2 or 3 times success sent email, the errors showed up again. On production server, after I recompiled the packages, first time run successfully, then error out. I am not sure why it start to error out? It is not consistent, sometimes works and sometimes not; I checked all the related documents regarding these errors. Nothing really matches our case. Does anyone can point me where I should look into it? What MTA are you running? Chris Berry [EMAIL PROTECTED] Systems Administrator JM Associates "Without change, something sleeps inside us, and seldom awakens. The sleeper must awaken." -- Duke Leto Atreides _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Chris Berry INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: utl_smtp error
Thanks Tom, I checked with stmp mail administrator, according to what she said, there is no maintenace and service outage going on recently. And she said she couldn't find any errors on the email log. joan "Mercadante, Thomas F" wrote: > > Joan, > > my experience with this error was that the email service (usually the > Outlook server) was not available when you tried to send mail. If I were > you, I would check with your Email Administrator to see if the service was > running. Maybe they were doing some weekly maintenance or something and the > email service went down. Could also be a network outage or something like > that. > > Hope this helps. > > Tom Mercadante > Oracle Certified Professional > > -Original Message- > Sent: Thursday, March 27, 2003 9:14 AM > To: Multiple recipients of list ORACLE-L > > Hi Dear List, > > Question again, > We have 3 databases on test server and one instance on production > server. 8.1.7.4 oracle; > None of them had those problem before. The email always working and had > been tested throughly. > Recently we got ORA-20001: 421 Service not available > ORA-06512: at "SYS.UTL_SMTP", line 83 > ORA-06512: at "SYS.UTL_SMTP", line 121 > ORA-06512: at line 5 > these errors. I noticed that some of ctxsys packages became invalid. > After I > recompiled all the objects, the errors are gone, it seems working. > However, after > 2 or 3 times success sent email, the errors showed up again. On > production > server, after I recompiled the packages, first time run successfully, > then > error out. > I am not sure why it start to error out? It is not consistent, > sometimes works and sometimes not; I checked all the related documents > regarding these errors. Nothing really matches our case. Does anyone can > point me where I should look into it? > > Thanks always, > > Joan > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.net > -- > Author: Joan Hsieh > INET: [EMAIL PROTECTED] > > Fat City Network Services-- 858-538-5051 http://www.fatcity.com > San Diego, California-- Mailing list and web hosting services > - > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.net > -- > Author: Mercadante, Thomas F > INET: [EMAIL PROTECTED] > > Fat City Network Services-- 858-538-5051 http://www.fatcity.com > San Diego, California-- Mailing list and web hosting services > - > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Joan Hsieh INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: utl_smtp error
Joan, my experience with this error was that the email service (usually the Outlook server) was not available when you tried to send mail. If I were you, I would check with your Email Administrator to see if the service was running. Maybe they were doing some weekly maintenance or something and the email service went down. Could also be a network outage or something like that. Hope this helps. Tom Mercadante Oracle Certified Professional -Original Message- Sent: Thursday, March 27, 2003 9:14 AM To: Multiple recipients of list ORACLE-L Hi Dear List, Question again, We have 3 databases on test server and one instance on production server. 8.1.7.4 oracle; None of them had those problem before. The email always working and had been tested throughly. Recently we got ORA-20001: 421 Service not available ORA-06512: at "SYS.UTL_SMTP", line 83 ORA-06512: at "SYS.UTL_SMTP", line 121 ORA-06512: at line 5 these errors. I noticed that some of ctxsys packages became invalid. After I recompiled all the objects, the errors are gone, it seems working. However, after 2 or 3 times success sent email, the errors showed up again. On production server, after I recompiled the packages, first time run successfully, then error out. I am not sure why it start to error out? It is not consistent, sometimes works and sometimes not; I checked all the related documents regarding these errors. Nothing really matches our case. Does anyone can point me where I should look into it? Thanks always, Joan -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Joan Hsieh INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
utl_smtp error
Hi Dear List, Question again, We have 3 databases on test server and one instance on production server. 8.1.7.4 oracle; None of them had those problem before. The email always working and had been tested throughly. Recently we got ORA-20001: 421 Service not available ORA-06512: at "SYS.UTL_SMTP", line 83 ORA-06512: at "SYS.UTL_SMTP", line 121 ORA-06512: at line 5 these errors. I noticed that some of ctxsys packages became invalid. After I recompiled all the objects, the errors are gone, it seems working. However, after 2 or 3 times success sent email, the errors showed up again. On production server, after I recompiled the packages, first time run successfully, then error out. I am not sure why it start to error out? It is not consistent, sometimes works and sometimes not; I checked all the related documents regarding these errors. Nothing really matches our case. Does anyone can point me where I should look into it? Thanks always, Joan -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Joan Hsieh INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services - To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
UTL_SMTP to send email
List, I am sending email from the database. I have UTL_SMTP setup which works fine. However in the message field I would like to query a table (using a select) rather than a hardcoded message. Not sure how to do this though. Anyone got any pointers will be greatly appreciated. PROCEDURE send_mail ( sender IN VARCHAR2, recipient IN VARCHAR2, subject IN VARCHAR2, message IN VARCHAR2 ) IS mailhost VARCHAR2 (30) := 'www'; mail_conn utl_smtp.connection; crlf VARCHAR2 (2) := CHR (13) || CHR (10); mesg VARCHAR2 (1000); BEGIN mail_conn := utl_smtp.open_connection (mailhost, 25); mesg := 'Date: ' || TO_CHAR (SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf || 'From: <' || sender || '>' || crlf || 'Subject: ' || subject || crlf || 'To: ' || recipient || crlf || '' || crlf || message; utl_smtp.helo (mail_conn, mailhost); utl_smtp.mail (mail_conn, sender); utl_smtp.rcpt (mail_conn, recipient); utl_smtp.data (mail_conn, mesg); utl_smtp.quit (mail_conn); END; Thanks & Regards Suhen
utl_smtp query
Hi again everybody, Since you were all so helpful last time, I'm going to bug you again. I've been fiddling with utl_smtp recently, trying to get the silly thing working without having to copy off an example. Sadly, in the end, I've had to copy :( I'm ripping off the example code from the orafaq site on utl_smtp (http://www-wnt.gsi.de/oragsidoc/doc_816/server.816/a76936/utl_smt6.htm#1001075) almost exaclty, so there's a 98% level of plagiarism :) The following code : CREATE OR REPLACE PROCEDURE send_mail (sender IN VARCHAR2, recipient IN VARCHAR2, message IN VARCHAR2)ISmailhost VARCHAR2(30) := 'mail';mail_conn utl_smtp.connection;BEGINmail_conn := utl_smtp.open_connection(mailhost, 25);utl_smtp.helo(mail_conn, mailhost);utl_smtp.mail(mail_conn, sender);utl_smtp.rcpt(mail_conn, recipient);utl_smtp.data(mail_conn, message);utl_smtp.quit(mail_conn);END; Returns this error : PLS-00201: identifier 'UTL_SMTP.CONNECTION' must be declared I have checked, and my db is installed with jserver. That's about all I can get about the error. _very_ novice PL/SQL developer here, and I'd love some feedback. Thanks guys and girls, Michael.
RE: How to send html using UTL_SMTP
One of our developers just wrote a package to do just that -- PACKAGE HTML_Mail IS PROCEDURE Send(P_TO IN VARCHAR2, P_FROM IN VARCHAR2, P_SUBJECT IN VARCHAR2, P_CC IN VARCHAR2 DEFAULT NULL, P_BCC IN VARCHAR2 DEFAULT NULL, P_TEXT IN VARCHAR2 DEFAULT NULL, P_HTML IN VARCHAR2); END HTML_Mail; PACKAGE BODY HTML_Mail IS -- Name:HTML_Mail.Send -- -- Description: Send HTML e-mail -- -- Parameters: P_TOTo Address(es) -- P_FROM From Address -- P_SUBJECT Subject -- P_CCCc Address(es) -- P_BCC Bcc Address(es) -- P_TEXT Plain text version of the message -- P_HTML HTML text version of the message -- PROCEDURE Send(P_TO IN VARCHAR2, P_FROM IN VARCHAR2, P_SUBJECT IN VARCHAR2, P_CC IN VARCHAR2 DEFAULT NULL, P_BCC IN VARCHAR2 DEFAULT NULL, P_TEXT IN VARCHAR2, P_HTML IN VARCHAR2) IS boundaryVARCHAR2(60) := 'Boundary_(ID_' || 'Boundary_(ID_' || TO_CHAR(SYSDATE, 'MISS_DDHH12_ MMYY_HH24_SSMI') || ')'; txtbody VARCHAR2(32000) := NULL; msgbody VARCHAR2(32000) := ' ' || p_subject || ' '; BEGIN plsql_mail.contact_smtpsrv(P_FROM, RTRIM(P_TO || ';' || P_CC || ';' || P_BCC, '; ')) ; plsql_mail.send_header('From', P_FROM); plsql_mail.send_header('To', P_TO); IF P_CC IS NOT NULL THEN plsql_mail.send_header('Cc', P_CC); END IF; plsql_mail.send_header('Subject', P_SUBJECT); plsql_mail.send_header('Content-type', 'multipart/alternative; boundary="' || boundary || '" This is a multi-part message in MIME format. --' || boundary || ' Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT ' || P_TEXT || ' --' || boundary || ' Content-type: text/html; charset=iso-8859-1 Content-transfer-encoding: 7BIT '); plsql_mail.send_body(P_HTML || ' --' || boundary || '--'); plsql_mail.signoff_smtpsrv; END Send; END HTML_Mail; / - PLSQL_MAIL is a package which interfaces with utl_smtp create or replace package plsql_mail as procedure contact_smtpsrv(sender in varchar2, recipients in varchar2); procedure send_header (name in varchar2, header in varchar2); procedure send_body(mail_text in varchar2); procedure signoff_smtpsrv; end plsql_mail; / create or replace package body plsql_mail as c utl_smtp.connection; procedure contact_smtpsrv(sender in varchar2, recipients in varchar2) is token_position number(5,0); recipient_string varchar2(2000); recipient varchar2(100); Begin c := utl_smtp.open_connection('http://messenger.msn.com.br -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eca Eca INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: MacGregor, Ian A. INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: How to send html using UTL_SMTP
Take a look at the UTL_HTTP package if you want to send and get HTTP requests. I built a little cross database communication system using this and ASP pages. One database could post a message that would be picked up by another database across firewalls since HTTP is usually open. However I found that if java wasn't installed it would just hang and never return an error. - Ethan -Original Message- Sent: Thursday, July 19, 2001 10:51 AM To: Multiple recipients of list ORACLE-L Hi friends : What can I do for send html text using UTL_SMTP. I have knowledgement using normal text but not with html. Regards. Thanks. Eriovaldo [EMAIL PROTECTED] Brazil _ Seja avisado de novas mensagens do Hotmail e use o comunique-se com seus amigos com o MSN Messenger em http://messenger.msn.com.br -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eca Eca INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- This e-mail is intended for the use of the addressee(s) only and may contain privileged, confidential, or proprietary information that is exempt from disclosure under law. If you have received this message in error, please inform us promptly by reply e-mail, then delete the e-mail and destroy any printed copy. Thank you. == -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Post, Ethan INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
How to send html using UTL_SMTP
Hi friends : What can I do for send html text using UTL_SMTP. I have knowledgement using normal text but not with html. Regards. Thanks. Eriovaldo [EMAIL PROTECTED] Brazil _ Seja avisado de novas mensagens do Hotmail e use o comunique-se com seus amigos com o MSN Messenger em http://messenger.msn.com.br -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Eca Eca INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
how to configure utl_smtp
hi can any one help me to configure UTL_SMTP PACKAGE AFTER INSTALLING THE UTL_SMTP.sql what steps need to be taken at the NT level (any things to be configured) the documentation gives the procedures how to use the package but i could not find how to configure the UTL_SMTP with the database on NT Thanks in advance shyam Get 250 color business cards for FREE! http://businesscards.lycos.com/vp/fastpath/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: prasad s INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: any dangers of using UTL_SMTP
Thank you very much everybody for your expert comments. That really helped me to put my case with manager who has concerns about using UTL_SMTP with loading java in database. Thanks again Sandesh -Original Message- Sent: Friday, July 06, 2001 4:38 PM To: Multiple recipients of list ORACLE-L Sandesh: We're running the same environment as you, except that we're using HP/UX 11.0 64-bit. I just ran the install scripts and everything's been working fine. This machine is (don't yell!) half-Test and half-Production, and the 8.1.6 database is the production half. It just worked. Good Luck! Mike --- === Michael P. Vergara | I've got a PBS mind in an MTV world Oracle DBA | Guidant Corporation | -Original Message- Sent: Friday, July 06, 2001 1:09 PM To: Multiple recipients of list ORACLE-L Dear Friends, I have a Oracle 8.1.6.2.0 database on HP-UX 11.0 of about 25M Shared pool about 10,000 db_block_buffers. One of our development team wants to use UTL_SMTP. I know I have install Jserver and run initjvm.sql to install all the classes. I want to know any dangers or problems people have faced using this and what are the precautions they have taken. Steps to set up Jserver to UTL_SMTP to work smoothly are appreciated. All replies are welcome. Thanks Sandesh Naik Oracle DBA -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Vergara, Michael (TEM) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Naik, Sandesh S INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: UTL_SMTP
thanks arno it works like a charm coz I am a novice Oracle Certifiable DBBS - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Wednesday, July 04, 2001 9:14 PM > Try this one: > > create or replace PROCEDURE send2 > (sender IN VARCHAR2, > recipient IN VARCHAR2, > subj IN VARCHAR2, > body IN VARCHAR2) > crlf VARCHAR2(2):= CHR( 13 ) || CHR( 10 ); > mesg VARCHAR2(4000); > mail_conn UTL_SMTP.CONNECTION; > cc_recipient VARCHAR2(50) default '[EMAIL PROTECTED]'; > bcc_recipient VARCHAR2(50) default '[EMAIL PROTECTED]'; > BEGIN > > mail_conn := utl_smtp.open_connection('mailhost', 25); > utl_smtp.helo(mail_conn, 'mailhost'); > utl_smtp.mail(mail_conn, sender); > utl_smtp.rcpt(mail_conn, recipient); > utl_smtp.rcpt(mail_conn, cc_recipient); > utl_smtp.rcpt(mail_conn, bcc_recipient); > mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf || > 'From: ' || sender || crlf || > 'To: ' || recipient || crlf || > 'Cc: ' || cc_recipient || crlf || > 'Bcc: ' || bcc_recipient || crlf || > 'Subject: ' || subj || crlf; > mesg:= mesg || '' || crlf || body; > utl_smtp.data(mail_conn, mesg); > utl_smtp.quit(mail_conn); > EXCEPTION > WHEN OTHERS THEN > dbms_output.put_line(sqlerrm); > END; > / > > Arno > -Original Message- > Sent: Wednesday, July 04, 2001 1:01 PM > To: Multiple recipients of list ORACLE-L > > > Hi Gurus, > > I am trying to used UTL_SMTP to send an e-mail form my oracle machine. I > tried the sample code from oracle documentation. > > PROCEDURE send_mail (senderIN VARCHAR2, >recipient IN VARCHAR2, >message IN VARCHAR2) > as > mailhostVARCHAR2(30) := 'mail.somewhere.com'; > mail_conn utl_smtp.connection; > > BEGIN > mail_conn := utl_smtp.open_connection(mailhost, 25); > utl_smtp.helo(mail_conn, mailhost); > utl_smtp.mail(mail_conn, sender); > utl_smtp.rcpt(mail_conn, recipient); > utl_smtp.data(mail_conn, message); > utl_smtp.quit(mail_conn); > EXCEPTION > WHEN OTHERS THEN > dbms_output.put_line('error'); > -- Handle the error > END; > > and i call the procedure from sqlplus > > > begin > send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]','test from oracle'); > end; > > > and i receive the e-mail like this > > > Return-Path: <[EMAIL PROTECTED]> > Delivered-To: [EMAIL PROTECTED] > Received: (qmail 3139 invoked from network); 4 Jul 2001 09:58:00 - > Received: from oracle.somewhere.com (HELO mail.somewhere.com) (192.169.0.25) > > by mail.somewhere.com with SMTP; 4 Jul 2001 09:58:01 - > X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) > > test form oracle > > > the problem is i lost the sender ( it sould be [EMAIL PROTECTED]) and the > title (i don't know where i must put the title). > > Regards, > > Herman > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Disser, Arno > INET: [EMAIL PROTECTED] > > Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California-- Public Internet access / Mailing Lists > > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). > -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: novicedba INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: any dangers of using UTL_SMTP
On Friday 06 July 2001 13:20, Mercadante, Thomas F wrote: > That only thing I don't like about it this - you can put *anything* in the > "from" area of the email address. Like: from Bill-Bob Bush, White House > USA. It seems wrong to me but, what the hey. > This isn't new. telnet to the smtp port of your mailserver, and you can easily spoof mail. anyone with a little knowledge will know to look in the full header though to see where it really came from. Jared -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Jared Still INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: any dangers of using UTL_SMTP
Sandesh: We're running the same environment as you, except that we're using HP/UX 11.0 64-bit. I just ran the install scripts and everything's been working fine. This machine is (don't yell!) half-Test and half-Production, and the 8.1.6 database is the production half. It just worked. Good Luck! Mike --- === Michael P. Vergara | I've got a PBS mind in an MTV world Oracle DBA | Guidant Corporation | -Original Message- Sent: Friday, July 06, 2001 1:09 PM To: Multiple recipients of list ORACLE-L Dear Friends, I have a Oracle 8.1.6.2.0 database on HP-UX 11.0 of about 25M Shared pool about 10,000 db_block_buffers. One of our development team wants to use UTL_SMTP. I know I have install Jserver and run initjvm.sql to install all the classes. I want to know any dangers or problems people have faced using this and what are the precautions they have taken. Steps to set up Jserver to UTL_SMTP to work smoothly are appreciated. All replies are welcome. Thanks Sandesh Naik Oracle DBA -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Vergara, Michael (TEM) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: any dangers of using UTL_SMTP
Sandesh, It works fine with minimal impact. Once you install Java, be sure and run initplsj.sql in the ORACLE_HOME/RDBMS/ADMIN directory, or else the utl_smtp will not work. If you follow the example in the docs for PL/SQL pre-defined procs, you should get the utl_smtp working just fine. If you have problems, drop me a line, and I will send you the stored procedure I use for the developers to call. I would suggest that you set this procedure up for them to use to make it easier for them, and for you to control the "From" address line. That only thing I don't like about it this - you can put *anything* in the "from" area of the email address. Like: from Bill-Bob Bush, White House USA. It seems wrong to me but, what the hey. Hope this helps. Tom Mercadante Oracle Certified Professional -Original Message- Sent: Friday, July 06, 2001 4:09 PM To: Multiple recipients of list ORACLE-L Dear Friends, I have a Oracle 8.1.6.2.0 database on HP-UX 11.0 of about 25M Shared pool about 10,000 db_block_buffers. One of our development team wants to use UTL_SMTP. I know I have install Jserver and run initjvm.sql to install all the classes. I want to know any dangers or problems people have faced using this and what are the precautions they have taken. Steps to set up Jserver to UTL_SMTP to work smoothly are appreciated. All replies are welcome. Thanks Sandesh Naik Oracle DBA -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Naik, Sandesh S INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
any dangers of using UTL_SMTP
Dear Friends, I have a Oracle 8.1.6.2.0 database on HP-UX 11.0 of about 25M Shared pool about 10,000 db_block_buffers. One of our development team wants to use UTL_SMTP. I know I have install Jserver and run initjvm.sql to install all the classes. I want to know any dangers or problems people have faced using this and what are the precautions they have taken. Steps to set up Jserver to UTL_SMTP to work smoothly are appreciated. All replies are welcome. Thanks Sandesh Naik Oracle DBA -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Naik, Sandesh S INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: UTL_SMTP
Arno, It works. thanks, Herman Quoting "Disser, Arno" <[EMAIL PROTECTED]>: > Try this one: > > create or replace PROCEDURE send2 > (sender IN VARCHAR2, > recipient IN VARCHAR2, > subj IN VARCHAR2, > body IN VARCHAR2) > crlf VARCHAR2(2):= CHR( 13 ) || CHR( 10 ); > mesg VARCHAR2(4000); > mail_conn UTL_SMTP.CONNECTION; > cc_recipient VARCHAR2(50) default '[EMAIL PROTECTED]'; > bcc_recipient VARCHAR2(50) default '[EMAIL PROTECTED]'; > BEGIN > > mail_conn:= utl_smtp.open_connection('mailhost', 25); > utl_smtp.helo(mail_conn, 'mailhost'); > utl_smtp.mail(mail_conn, sender); > utl_smtp.rcpt(mail_conn, recipient); > utl_smtp.rcpt(mail_conn, cc_recipient); > utl_smtp.rcpt(mail_conn, bcc_recipient); > mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf || > 'From: ' || sender || crlf || > 'To: ' || recipient || crlf || > 'Cc: ' || cc_recipient || crlf || > 'Bcc: ' || bcc_recipient || crlf || > 'Subject: ' || subj || crlf; > mesg:= mesg || '' || crlf || body; > utl_smtp.data(mail_conn, mesg); > utl_smtp.quit(mail_conn); > EXCEPTION > WHEN OTHERS THEN > dbms_output.put_line(sqlerrm); > END; > / > > Arno > -Original Message- > Sent: Wednesday, July 04, 2001 1:01 PM > To: Multiple recipients of list ORACLE-L > > > Hi Gurus, > > I am trying to used UTL_SMTP to send an e-mail form my oracle machine. I > tried the sample code from oracle documentation. > > PROCEDURE send_mail (senderIN VARCHAR2, >recipient IN VARCHAR2, >message IN VARCHAR2) > as > mailhostVARCHAR2(30) := 'mail.somewhere.com'; > mail_conn utl_smtp.connection; > > BEGIN > mail_conn := utl_smtp.open_connection(mailhost, 25); > utl_smtp.helo(mail_conn, mailhost); > utl_smtp.mail(mail_conn, sender); > utl_smtp.rcpt(mail_conn, recipient); > utl_smtp.data(mail_conn, message); > utl_smtp.quit(mail_conn); > EXCEPTION > WHEN OTHERS THEN > dbms_output.put_line('error'); > -- Handle the error > END; > > and i call the procedure from sqlplus > > > begin > send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]','test from oracle'); > end; > > > and i receive the e-mail like this > > > Return-Path: <[EMAIL PROTECTED]> > Delivered-To: [EMAIL PROTECTED] > Received: (qmail 3139 invoked from network); 4 Jul 2001 09:58:00 - > Received: from oracle.somewhere.com (HELO mail.somewhere.com) > (192.169.0.25) > > by mail.somewhere.com with SMTP; 4 Jul 2001 09:58:01 - > X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) > > test form oracle > > > the problem is i lost the sender ( it sould be [EMAIL PROTECTED]) and > the > title (i don't know where i must put the title). > > Regards, > > Herman > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Disser, Arno > INET: [EMAIL PROTECTED] > > Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California-- Public Internet access / Mailing Lists > > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). > > -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
RE: UTL_SMTP
Try this one: create or replace PROCEDURE send2 (sender IN VARCHAR2, recipient IN VARCHAR2, subj IN VARCHAR2, body IN VARCHAR2) crlf VARCHAR2(2):= CHR( 13 ) || CHR( 10 ); mesg VARCHAR2(4000); mail_conn UTL_SMTP.CONNECTION; cc_recipient VARCHAR2(50) default '[EMAIL PROTECTED]'; bcc_recipient VARCHAR2(50) default '[EMAIL PROTECTED]'; BEGIN mail_conn := utl_smtp.open_connection('mailhost', 25); utl_smtp.helo(mail_conn, 'mailhost'); utl_smtp.mail(mail_conn, sender); utl_smtp.rcpt(mail_conn, recipient); utl_smtp.rcpt(mail_conn, cc_recipient); utl_smtp.rcpt(mail_conn, bcc_recipient); mesg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf || 'From: ' || sender || crlf || 'To: ' || recipient || crlf || 'Cc: ' || cc_recipient || crlf || 'Bcc: ' || bcc_recipient || crlf || 'Subject: ' || subj || crlf; mesg:= mesg || '' || crlf || body; utl_smtp.data(mail_conn, mesg); utl_smtp.quit(mail_conn); EXCEPTION WHEN OTHERS THEN dbms_output.put_line(sqlerrm); END; / Arno -Original Message- Sent: Wednesday, July 04, 2001 1:01 PM To: Multiple recipients of list ORACLE-L Hi Gurus, I am trying to used UTL_SMTP to send an e-mail form my oracle machine. I tried the sample code from oracle documentation. PROCEDURE send_mail (senderIN VARCHAR2, recipient IN VARCHAR2, message IN VARCHAR2) as mailhostVARCHAR2(30) := 'mail.somewhere.com'; mail_conn utl_smtp.connection; BEGIN mail_conn := utl_smtp.open_connection(mailhost, 25); utl_smtp.helo(mail_conn, mailhost); utl_smtp.mail(mail_conn, sender); utl_smtp.rcpt(mail_conn, recipient); utl_smtp.data(mail_conn, message); utl_smtp.quit(mail_conn); EXCEPTION WHEN OTHERS THEN dbms_output.put_line('error'); -- Handle the error END; and i call the procedure from sqlplus begin send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]','test from oracle'); end; and i receive the e-mail like this Return-Path: <[EMAIL PROTECTED]> Delivered-To: [EMAIL PROTECTED] Received: (qmail 3139 invoked from network); 4 Jul 2001 09:58:00 - Received: from oracle.somewhere.com (HELO mail.somewhere.com) (192.169.0.25) by mail.somewhere.com with SMTP; 4 Jul 2001 09:58:01 - X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) test form oracle the problem is i lost the sender ( it sould be [EMAIL PROTECTED]) and the title (i don't know where i must put the title). Regards, Herman -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Disser, Arno INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
UTL_SMTP
Hi Gurus, I am trying to used UTL_SMTP to send an e-mail form my oracle machine. I tried the sample code from oracle documentation. PROCEDURE send_mail (sender IN VARCHAR2, recipient IN VARCHAR2, message IN VARCHAR2) as mailhost VARCHAR2(30) := 'mail.somewhere.com'; mail_conn utl_smtp.connection; BEGIN mail_conn := utl_smtp.open_connection(mailhost, 25); utl_smtp.helo(mail_conn, mailhost); utl_smtp.mail(mail_conn, sender); utl_smtp.rcpt(mail_conn, recipient); utl_smtp.data(mail_conn, message); utl_smtp.quit(mail_conn); EXCEPTION WHEN OTHERS THEN dbms_output.put_line('error'); -- Handle the error END; and i call the procedure from sqlplus begin send_mail('[EMAIL PROTECTED]','[EMAIL PROTECTED]','test from oracle'); end; and i receive the e-mail like this Return-Path: <[EMAIL PROTECTED]> Delivered-To: [EMAIL PROTECTED] Received: (qmail 3139 invoked from network); 4 Jul 2001 09:58:00 - Received: from oracle.somewhere.com (HELO mail.somewhere.com) (192.169.0.25) by mail.somewhere.com with SMTP; 4 Jul 2001 09:58:01 - X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) test form oracle the problem is i lost the sender ( it sould be [EMAIL PROTECTED]) and the title (i don't know where i must put the title). Regards, Herman
RE: Utl_Smtp trouble
did you run caths.sql when you created the data dictionary? -Original Message- Sent: Tuesday, June 12, 2001 7:32 PM To: Multiple recipients of list ORACLE-L Hi, I tried to send e-mail with Utl_Smtp package. At the line c := utl_smtp.open_connection('MySmtpServerAddress.com'); I always get the error message: " Service not available.Utl_Smtp line 83.Utl_Smtp line 344" What should be wrong? I tried this at two different customers with 8.1.6 and 8.1.7 versions. Both customers have internet through ethernet(intranet) connection. Thank you in advance. Zsolt Csillag, Hungary -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Csillag Zsolt INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Paul Drake INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Utl_Smtp trouble
Hi, I tried to send e-mail with Utl_Smtp package. At the line c := utl_smtp.open_connection('MySmtpServerAddress.com'); I always get the error message: " Service not available.Utl_Smtp line 83.Utl_Smtp line 344" What should be wrong? I tried this at two different customers with 8.1.6 and 8.1.7 versions. Both customers have internet through ethernet(intranet) connection. Thank you in advance. Zsolt Csillag, Hungary -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Csillag Zsolt INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Re: Q: UTL_SMTP
HTH & YMMV! REATE OR REPLACE PACKAGE BODY mwh816 AS PROCEDURE send_mail (senderIN VARCHAR2, recipient IN VARCHAR2, message IN VARCHAR2) IS mailhost VARCHAR2(30) := 'chiron.mwh.com'; mail_conn utl_smtp.connection; work_stringVARCHAR2(1023); ndxINTEGER; comma CHAR(1) := CHR(44); BEGIN dbms_output.enable(10); mail_conn := utl_smtp.open_connection(mailhost, 25); utl_smtp.helo(mail_conn, mailhost); utl_smtp.mail(mail_conn, sender); work_string := recipient; ndx := instr(work_string,comma)-1; while (ndx > 0 ) LOOP dbms_output.put_line(substr(work_string,0,ndx)); utl_smtp.rcpt(mail_conn, substr(work_string,0,ndx)); work_string := substr(work_string,ndx+2,length(work_string)-ndx); ndx := instr(work_string,comma)-1; END LOOP; utl_smtp.rcpt(mail_conn, work_string); dbms_output.put_line(work_string); utl_smtp.data(mail_conn, message); utl_smtp.quit(mail_conn); EXCEPTION WHEN OTHERS THEN -- Handle the error RAISE; END; END mwh816; Schoen Volker wrote: > > Hi list, > > I have a problem with package UTL_SNMP. I have a procedure which sends mails > to special recipient. My problem is, that the body of the message > (utl_smtp.data(mail_conn, message);) will not be sent. Any help is welcome. > Following the procedure. > > create or replace PROCEDURE sendmail > AS >sERROR_CODE VARCHAR2(10); >sERROR_TEXT VARCHAR2(250); >mailhostVARCHAR2(30) := 'mailhost'; >mail_conn utl_smtp.connection; >sender varchar2(20) :='[EMAIL PROTECTED]'; >recipientvarchar2(50) :='[EMAIL PROTECTED]'; >message varchar2(200) :='This is the message text.'; > BEGIN > mail_conn := utl_smtp.open_connection(mailhost, 25); > utl_smtp.helo(mail_conn, mailhost); > utl_smtp.mail(mail_conn, sender); > utl_smtp.rcpt(mail_conn, recipient); > utl_smtp.data(mail_conn, message); > utl_smtp.quit(mail_conn); > EXCEPTION > WHEN OTHERS THEN > sERROR_CODE := 'ORA' || SQLCODE; > sERROR_TEXT := sERROR_TEXT || ' ' || SQLERRM; > > INSERT INTO ELREFADMIN.MAILERROR > ( ERROR_CODE, ERROR_TEXT) > VALUES (sERROR_CODE, sERROR_TEXT); > END; > / > > TIA > > Volker Schön > E-Mail: mailto:[EMAIL PROTECTED] > http://www.inplan.de > > -- > Please see the official ORACLE-L FAQ: http://www.orafaq.com > -- > Author: Schoen Volker > INET: [EMAIL PROTECTED] > > Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California-- Public Internet access / Mailing Lists > > To REMOVE yourself from this mailing list, send an E-Mail message > to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Charlie Mengler Maintenance Warehouse [EMAIL PROTECTED] 10641 Scripps Summit Ct 858-831-2229 San Diego, CA 92131 The future is here. It is just not evenly distributed. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Charlie Mengler INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
Q: UTL_SMTP
Hi list, I have a problem with package UTL_SNMP. I have a procedure which sends mails to special recipient. My problem is, that the body of the message (utl_smtp.data(mail_conn, message);) will not be sent. Any help is welcome. Following the procedure. create or replace PROCEDURE sendmail AS sERROR_CODE VARCHAR2(10); sERROR_TEXT VARCHAR2(250); mailhostVARCHAR2(30) := 'mailhost'; mail_conn utl_smtp.connection; sender varchar2(20) :='[EMAIL PROTECTED]'; recipientvarchar2(50) :='[EMAIL PROTECTED]'; message varchar2(200) :='This is the message text.'; BEGIN mail_conn := utl_smtp.open_connection(mailhost, 25); utl_smtp.helo(mail_conn, mailhost); utl_smtp.mail(mail_conn, sender); utl_smtp.rcpt(mail_conn, recipient); utl_smtp.data(mail_conn, message); utl_smtp.quit(mail_conn); EXCEPTION WHEN OTHERS THEN sERROR_CODE := 'ORA' || SQLCODE; sERROR_TEXT := sERROR_TEXT || ' ' || SQLERRM; INSERT INTO ELREFADMIN.MAILERROR ( ERROR_CODE, ERROR_TEXT) VALUES (sERROR_CODE, sERROR_TEXT); END; / TIA Volker Schön E-Mail: mailto:[EMAIL PROTECTED] http://www.inplan.de -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Schoen Volker INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).