Send an email from the command line

Sendmail

You can use the mail command. I believe it relies on sendmail by default.

echo -e "message body" | mail -s "message subject" whoever@example.com

With php

php -r "mail('whoever@example.com', 'message subject', 'message body');"

Last modified: 10/11/2015 Tags:

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top