Error when using UTL_SMTP to send email from PLSQL
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));