sendEmail Server

Started by Pi3141, April 26, 2018, 12:41:48 PM

Previous topic - Next topic

Pi3141

Hi, i have a problem with sendEmail, i would like to use my pc as a stmp server (in localhost), could someone help me?

command:
sendemail -f mail@acaso.com -t  miaemail@mail.com -u ciao -m hey

Error:
apr 26 10:37:26 asus sendemail[5494]: ERROR => Connection attempt to localhost:25 failed: IO::Socket::INET6: connect: Connection refused

drego85

It's very simple, you do not have a SMTP server installed on your BackBox.

You have two alternatives:
1. Install and Configure PostFix (How TO: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04)
2. Use an external SMTP server (es. sendemail -f fromuser@gmail.com -t touser@domain.com -u subject -m "message" -s smtp.gmail.com:587 -o tls=yes -xu gmailaccount@gmail.com -xp gmailpassword)
Andrea Draghetti
Personal Blog

ostendali

in order to send emails from your pc you do not necessarily need an smtp server.

either follow what drego85 suggested or simply install postfix "apt install posfix mailx && systemctl enable/start postfix" and simply send email i.e:

echo "Email test" | mail -s "This email sent : $( date '+%d/%m/%Y' ) from $( hostname )" youremail@example.com

or look at mail command man page