Report this

What is the reason for this report?

Can I read and send emails by Console SSH? How to do it?

Posted on October 10, 2015
Nay

By Nay

How Can I Acess my Webmail?

Can I read and send emails by Console SSH?

I am using CentoS on Apache.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

In order to use email, you would need to install a mail application, but you may not want to do that: https://www.digitalocean.com/community/tutorials/why-you-may-not-want-to-run-your-own-mail-server

What kind of webmail application are you using? With more detail, we may be able to offer assistance.

Yes, you can read and send emails via SSH using the console. Here’s how:

1. Install a Command-Line Mail Client:

  • Debian/Ubuntu:
sudo apt-get install mailutils
  • CentOS/RHEL:
sudo yum install mailx

2. Send an Email:

echo "Email body text" | mail -s "Subject here" recipient@example.com

3. Read Emails:

  • Use mail to list and read emails:
mail
  • Navigate using:
    • Enter to read the next message.
    • ? for help.
    • q to quit.

Note:

You need a properly configured mail server (like Postfix) on your server to send and receive emails. Also, you’ll need to use safe ports lik 456 or 587

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.