How do i send an email from command prompt?

12,801

Version for terminal:

mail [email protected]

Version for shell scripts:

echo "This is a short email" | mail -n -s "Sending email" [email protected]

AFAIK typical Linux distribution install MTA (sendmail/postfix/exim/...) by default. If you have static public IP address then its quite possible you have a working self-configuration.

Configuration of MTA without static public IP is more tricky.

Share:
12,801
alvas
Author by

alvas

食飽未?

Updated on June 04, 2022

Comments

  • alvas
    alvas almost 2 years

    Is there any way to send a simple email as such at linux terminal?

    to: [email protected]
    sub: Sending email from linux terminal
    body: This is a short email sent from linux terminal
    

    What kind of stack or smtp do i need to setup? How do I set them up?