Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save soufianem370/0335450046e9e53ef230231d144ec893 to your computer and use it in GitHub Desktop.
Save soufianem370/0335450046e9e53ef230231d144ec893 to your computer and use it in GitHub Desktop.

Revisions

  1. @ilkereroglu ilkereroglu created this gist Sep 22, 2015.
    33 changes: 33 additions & 0 deletions simply-sending-e-mails-with-mailx.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    ### Installing mailx

    ```shell
    yum -y update
    ```

    ```shell
    yum install -y mailx
    ```
    We can now start sending e-mails using

    **create a symbolic link**
    ```shell
    ln -s /bin/mailx /bin/email
    ```
    ###Set an External SMTP Server to Relay E-Mails
    ```shell
    vi /etc/mail.rc
    ```
    edit
    ```
    set smtp=smtps://smtp.gmail.com:465
    set smtp-auth=login
    set [email protected]
    set smtp-auth-password=YOURPASSWORD
    set ssl-verify=ignore
    set nss-config-dir=/etc/pki/nssdb/
    ```
    example usage :

    ```shell
    echo "Your message" | mail -v -s "Message Subject" email@address
    ```