Home » SQL & PL/SQL » SQL & PL/SQL » problem with utl_smtp_data
problem with utl_smtp_data [message #260211] Fri, 17 August 2007 13:25 Go to next message
smouff
Messages: 1
Registered: August 2007
Location: canada
Junior Member

i am trying to use oracle to send an email
with this procedure


SQL> create or replace procedure savoie_send_mail (
2 sender IN VARCHAR2,
3 recipient IN VARCHAR2,
4 message IN VARCHAR2)
5 IS
6 mailhost VARCHAR2(30) := 'mail.vigie.com';
7 mail_conn utl_smtp.connection;
8 BEGIN
9 mail_conn := utl_smtp.open_connection(mailhost, 25);
10 utl_smtp.helo(mail_conn, mailhost);
11 utl_smtp.mail(mail_conn, sender);
12 utl_smtp.rcpt(mail_conn, recipient);
13 utl_smtp.data(mail_conn, message);
14 utl_smtp.quit(mail_conn);
15 END;
16
17 /

exec savoie_send_mail ('michel.savoie@vigie.com' , 'michel.savoie@vigie.com','hello héhéhé');

it works i receive the email but the message lost the accents....

help please

Michel
Re: problem with utl_smtp_data [message #260228 is a reply to message #260211] Fri, 17 August 2007 13:54 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
First,
Please read and follow How to format your posts
Make sure that lines of code do not exceed 80 or 100 characters when you format.
Please always post your Oracle version (4 decimals).

Then,
Insert this line before your data:
"content-type: text/plain; charset=<your character set>"
Default character set is "us-ascii" so without accent.

Regards
Michel
Re: problem with utl_smtp_data [message #260230 is a reply to message #260211] Fri, 17 August 2007 14:00 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Take a look at the email headers to see if any characterset is specified. Do a hex dump of the message to see if the wrong bytes are being received - of the mail client is displaying it incorrently based on the characterset.

See http://www.psoug.org/reference/utl_smtp.html
Previous Topic: Delete using ranking function
Next Topic: counting commas from numeric(amount)
Goto Forum:
  


Current Time: Sat Dec 10 11:12:26 CST 2016

Total time taken to generate the page: 0.07489 seconds