PL/SQL (MOSC)

MOSC Banner

Error when using UTL_SMTP to send email from PLSQL

in PL/SQL (MOSC) 1 commentAnswered

We are trying to send an email from PLSQL using UTL_SMTP package (sample code below)

mail_connection := utl_smtp.open_connection
(
host => mailhost,
port => l_port,
wallet_path => wallet_loc,
wallet_password => wallet_pwd,
secure_connection_before_smtp => FALSE
);
utl_smtp.ehlo(mail_connection , mailhost);
utl_smtp.starttls(mail_connection);
utl_smtp.ehlo(mail_connection , mailhost);

UTL_SMTP.AUTH(
c => mail_connection,
username => user_name,
password => user_pwd,
schemes => 'LOGIN'
);

utl_smtp.mail(mail_connection, sender);
utl_smtp.rcpt(mail_connection, recipient);
utl_smtp.open_data(mail_connection);
utl_smtp.write_data(mail_connection, 'This is a test message using SSL with SMTP.' || chr(13));

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center