Oracle Cloud Infrastructure Documentation

Integrating Mailx with Email Delivery

Configure Mailx to Send Email Through Email Delivery

You can use Mailx to send emails through Email Delivery. Before you use Mailx you must configure Oracle Cloud Infrastructure Email Delivery in your Mailx application.

Note

These steps assume you are logged into an Oracle Linux instance. Other distributions of Linux may have different commands and file locations.

To enable Mailx to integrate with Email Delivery:

  1. Make sure Email Delivery is configured to send email. See Getting Started with Email Delivery.

Note

The SMTP credentials are required to configure Mailx to use Email Delivery. Be sure to note the user name and password when you generate the SMTP credentials.

  1. Update the Mailx mail.rc file.

    To open the mail.rc file, run the following command:

    sudo vi ~/etc/mail.rc

    Add the following information to the end of the file:

    #smtp config

    set nss-config-dir=/etc/pki/nssdb/
    set smtp-use-starttls
    set smtp-auth=plain
    set smtp=<SMTP connection endpoint>:25
    set from=<from_email_address>
    set smtp-auth-user=<OCID from smtp credentials>
    set smtp-auth-password=<password from smtp credentials>

    #write and quit file
    :wq!
  2. Test the configuration by sending a test email.

    Run the following command:

    echo "Test Email" | mail -v -s "Send an email via mailx" -r "from_name<from_email_address>" -S replyto="from_name><from_email_address>" -S smtp="SMTP connection endpoint:25" -S smtp-use-starttls -S smtp-auth=plain -S smtp-auth-user='<ocid from smtp credentials>' -S smtp-auth-password='<password from smtp credentials>' -S ssl-verify=ignore <recipient_email_address>

More Information

  • For network security services, see the Mailx documentation.