1.Используя Sendmail
1 |
# nano /root/email.txt |
1 2 |
Subject: Test message via sendmail Hi there! This is only test message |
Тема сообщения указана после Subject:
1 |
# sendmail user1@domain.com < /root/email.txt |
2.Используя Mail
1 |
# apt-get install mailutils |
1 |
# mail -s "Test message via mail" user1@domain.com < /root/email.txt |
(либо < /dev/null – для отправки пустого сообщения) При отправке вложения
1 |
# mail -a /root/email.txt -s "Test attachment via mail" user1@domain.com < /dev/null |
Отправка нескольким адресатам
1 |
# mail -s "Test message via mail" user1@domain.com,user1@domain2.com < /root/email.txt |
3.Используя Mutt
1 |
# mutt -s "Test message via mutt" user1@domain.com < /dev/null |
При отправке вложения
1 |
# mutt -a /tmp/email.txt -s "Test message via mutt" user1@domain.com < /dev/null |
4.Используя Telnet
1 |
# telnet localhost 25 |
1 2 3 4 5 |
Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 app02.XXXXXXX.XXX ESMTP Postfix (Debian/GNU) |
1 |
ehlo localhost |
1 2 3 4 5 6 7 8 9 |
250-app02.XXXXXXX.XXX 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-STARTTLS 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN |
1 |
mail from: user1@domain.com |
1 |
250 2.1.0 Ok |
1 |
rcpt to: user1@domain2.com |
1 |
250 2.1.5 Ok |
1 |
DATA |
1 |
354 End data with <CR><LF>.<CR><LF> |
1 |
Subject: Test message via telnet |
1 |
This is only test message |
1 |
. |
1 |
250 2.0.0 Ok: queued as B46B960289 |
1 |
quit |
[…]