How to send email from oracle plsql through third party hosting mail server
NickName:Abdullah Zabarah Ask DateTime:2017-11-23T15:51:11

How to send email from oracle plsql through third party hosting mail server

Deal all, I want to send an email notification directly form Oracle plsql using outer mail server (External hosting), I've searched on the internet and found a useful way to send an email using Oracle UTL_smtp package, but it requires to have the mail server locally not remotely.

CREATE OR REPLACE PROCEDURE SEND_MAIL (
msg_to varchar2,
msg_subject varchar2,
msg_text varchar2 )
IS
c utl_smtp.connection;
rc integer;
msg_from varchar2(50) := 'Oracle9.2';
mailhost VARCHAR2(30) := '127.0.0.1'; -- local database host

BEGIN
c := utl_smtp.open_connection(mailhost, 25); -- SMTP on port 25
utl_smtp.helo(c, mailhost);
utl_smtp.mail(c, msg_from);
utl_smtp.rcpt(c, msg_to);

utl_smtp.data(c,'From: Oracle Database' || utl_tcp.crlf ||
'To: ' || msg_to || utl_tcp.crlf ||
'Subject: ' || msg_subject ||
utl_tcp.crlf || msg_text);
utl_smtp.quit(c);

EXCEPTION
WHEN UTL_SMTP.INVALID_OPERATION THEN
dbms_output.put_line(' Invalid Operation in Mail attempt
using UTL_SMTP.');
WHEN UTL_SMTP.TRANSIENT_ERROR THEN
dbms_output.put_line(' Temporary e-mail issue - try again');
WHEN UTL_SMTP.PERMANENT_ERROR THEN
dbms_output.put_line(' Permanent Error Encountered.');
END;

So, how can this be done using external domain!! Please help..

Copyright Notice:Content Author:「Abdullah Zabarah」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/47450137/how-to-send-email-from-oracle-plsql-through-third-party-hosting-mail-server

More about “How to send email from oracle plsql through third party hosting mail server” related questions

How to send email from oracle plsql through third party hosting mail server

Deal all, I want to send an email notification directly form Oracle plsql using outer mail server (External hosting), I've searched on the internet and found a useful way to send an email using Ora...

Show Detail

attach a file into the mail from unix db server through plsql

I want to send the content of a table as a mail attachment using utl_smtp. I am able to extract the content from the table into an excel file by implementing a package mentioned in this url ( http...

Show Detail

Using MailKit to connect to a mail server from a third-party hosting provider

If I am hosting an asp.net core app through a third-party hosting provider such as A2 Hosting is it possible to use this to send mail w/ Mail Kit? I have tried so many different things and client.C...

Show Detail

How to send email through server alias mail

I've create a script that used the ipn of PayPal. All working perfectly, after the purchasing the data of the clients are inserted in the database. But recently the server of my hosting provider do...

Show Detail

Node JS. How to send email without third-party mail server

I need to send (and maybe in the future also receive) email to Node JS without the help of third party servers (such as gmail). I found node-mailer-direct-transport, but it looks like it is outdate...

Show Detail

Finding Outlook event triggered by third party email send

I have a third party piece of software that sends email through Outlook. It allows us to specify a "reply to" email address, but not a "from" email address. I'm trying to write something in VBA that

Show Detail

How to send email using third party email server

I have a requirement, where registered user can send email thru my application using my email server how can i achieve this? Example: Registered user email : [email protected], My email server : mail....

Show Detail

How to send mass email to my users and get a response from the mail server

I'm sending emails to about 10,000 of our registered users. In the past we have had issues of not all of the emails being sent out. I spoke to the mail server admin and he suggested I get a disti...

Show Detail

Email protocol, mail server change and using another protocol from exist hosting

I have a domain which name is asifulmamun.info Then, I've purchased a hosting for host website and connect this domain to hosting with cpanel by nameserver change. I've create an email with this do...

Show Detail

Third party email service and SPF

I am using third party email service (mailing list, like Mailchimp or similar) and I have included ip-address of that server on SPF record in my domain name. Same third party email service is used...

Show Detail