Sending Mails From A Linux Server

In this example we use Ubuntu linux.

First test if you can access gmail through port 25: telnet gmail-smtp-in.l.google.com 25

Test mail with: echo "Hello world" | mail -s "Test Email" -a "From: [email protected]" toMail.com

 

Mail configuration

/etc/mailname > grn.dk

/etc/hostname > grn.dk

/etc/hosts > [IP] grn.dk localhost

/etc/postfix/main.cf >
myhostname = grn.dk
mydestination = grn.dk, localhost
relayhost = [EMPTY]
 

Last modified
2021-03-10
Tags