This content has been marked as final. Show 6 replies
What code? I don't see any code in what you posted? Do you?
What mail server?
10gR1 or 10gR2? Provide full version number please also.
create or replace PROCEDURE MAIL_SP
(name_in IN Varchar, surname_in IN Varchar, email_in IN Varchar)
conn := utl_smtp.open_connection ( 'mail.xxx.com', 25 ); -- SMTP database host and on port 25
utl_smtp.helo( conn, 'mail.xxx.com' );
utl_smtp.mail( conn, 'email@example.com' );
utl_smtp.rcpt( conn, email_in );
'From: Me' || utl_tcp.crlf ||
'To: ' || email_in || utl_tcp.crlf ||
'Subject: ' || 'Confirmation' ||
utl_tcp.crlf || 'Dear'||' '||name_in||' '||surname_in||','
||chr(13)||chr(10)||chr(13)||chr(10)||'Welcome and thank you!'
Oracle Database 10g Release 10201_win32
In 10.2 you should be using UTL_MAIL not the obsolete UTL_SMTP.
You will find working demos of both in Morgan's Library at www.psoug.org.
One warning ... you must have an internal email server and unchallenged access to use it. This can not be used with any email system that challenges for user-id and password either internal or external (for example gmail, yahoo, hotmail).
I tried utl_mail and i still get exact errors that are;
SMTP permanent error: 550 relay not permitted
SMTP permanent error: 530 5.7.0 Authentication required
Message was edited by:
Here's what I wrote above:
"You must have an internal email server and unchallenged access to use it. This can not be used with any email system that challenges for user-id and password"
Here's your error message:
"530 5.7.0 Authentication required"
Nothing more need to said.
Which part of the advice I gave you didn't you understand?
> I tried utl_mail and i still get exact errors that are;
Which are NOT Oracle errors at all - but errors returned by the SMTP server as it is not satisfied with your client requests to it. It cannot service these.
> SMTP permanent error: 550 relay not permitted
This means that (very correctly!) a server on domain B will not accept mail from a client on domain A that is to be send to a recipient on domain C. Domain B will not serve as a relay for domain A to get mail into domain C.
A standard anti-spam measure. One that if not implemented, will get the domain B SMTP server blacklisted on the Internet.
> SMTP permanent error: 530 5.7.0 Authentication required
Quite clearly the SMTP server expects your mail client (your PL/SQL code) to provide authentication details. Read [url http://www.faqs.org/rfcs/rfc2554.html]RFC 2554 - SMTP Service Extension for Authentication.
A pet beef of mine - how on earth can programmers expect to use an application protocol (like SMTP) when not even knowing the basics of the RFC that contains that protocol's specification?