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
-- 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 -0000
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 -0000
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