mailx Not Sending Email

7,377

mailx is a client, you still need an MTA like postfix/sendmail/exim, or specify a server

$ mailx -v -s "$EMAIL_SUBJECT" \
-S smtp=smtp://smtp.ust.hk \
-S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" \
$TO_EMAIL_ADDRESS

source

Another Example

(options vary but I think this is right for rhl)

Share:
7,377

Related videos on Youtube

GTS Joe
Author by

GTS Joe

I'm a Full Stack Web Developer from California. I love PHP, Laravel, JavaScript, jQuery, AJAX, MySQL, Linux, Apache and all aspects of development: Backend, frontend, database, etc.

Updated on September 18, 2022

Comments

  • GTS Joe
    GTS Joe over 1 year

    I installed mailx in my Linux webserver running CentOS 7. When I try to send a test email,

    echo "Body test." | mail -r "[email protected]" -s "Subject Test" [email protected]
    

    I check my email and don't receive anything. However, if I use the mailq command, I get this:

    postqueue: warning: Mail system is down -- accessing queue directly
    -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
    7805D2DF        422 Wed Jan 11 15:00:40  [email protected]
                                             [email protected]