Sending emails from OCI with Email Delivery service in node.js

Oracle Cloud Infrastructure Email Delivery is an email sending service that provides a fast and reliable managed solution for sending high-volume emails that need to reach your recipients’ inbox. Email Delivery provides the tools necessary to send application-generated email for mission-critical communications such as receipts, fraud detection alerts, multi-factor identity verification, and password resets.

Go to a IAM/user and click on [Generate SMTP Credentials] as shown below:

Keep the credentials created in a safe place:

Create an Approved Sender (an real existing email account to put in the from field):

Grab the connection details:

Now test the code:
npm install nodemailer

Create a sendmail.js file:

var nodemailer = require('nodemailer');
async function main() {
    let testAccount = await nodemailer.createTestAccount();
    let transporter = nodemailer.createTransport({
      host: "",
      port: 25,
      secure: false,
      auth: {
        user: '', 
        pass: 'BD..._', 
    let info = await transporter.sendMail({
      from: '"', 
      to: "", 
      subject: "ssh access to",
      html: "<b>ssh -i deltakey -o ProxyCommand=\"ssh -i deltakey -W %h:%p -p 22\" -p 22 opc@</b>", 
    console.log("Message sent: %s", info.messageId);
    console.log("Preview URL: %s", nodemailer.getTestMessageUrl(info));

Test it:

node sendmail.js

That’s all, hope it helps! 🙂


  1. Abhishek

    Gives 535 error when secure is false. When secure is true, there is an error with sslv3, which also added via ttl option in nodemailer transporter.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.