0

I have been trying to send emails with ssmtp through my outlook account. I followed this page and this is what I have inside ssmtp.conf:

root=myemail@outlook.com
mailhub=smtp-mail.outlook.com:587
AuthUser=myemail@outlook.com
AuthPass=mypassword
UseTLS=YES
UseSTARTTLS=YES
rewriteDomain=outlook.com
hostname=myemail@outlook.com
FromLineOverride=YES 

But when I want o test ssmtp, like by typing this in the terminal:

ssmtp destination@gmail.com

nothing happens, and the terminal freezes. Any clue where I can start debugging this?

SaTa
  • 996
  • I presume the terminal isn't frozen but ssmtp awaits your input (mail content) in its stdin. Type a few words and hit CTRL-D to end your message. – PerlDuck Nov 16 '18 at 08:06
  • Thanks, you are right. It was not frozen, but I still could not send emails. I switched to postfix and it seems to be working now. – SaTa Nov 17 '18 at 03:45
  • I had the same problem: You can't use myemail@outlook.com as hostname. Use myemail or localhost instead. But now I receive the mails, but void mail, without text and void attachments. – davide martincich May 02 '19 at 14:07
  • @SaTa, would you please teach me how to config postfix to login outlook? I am using ubuntu 20.04 – linrongbin Aug 03 '21 at 04:11

1 Answers1

0

After couple of trials, I have realized that there are two ways to use this command.

Email from file

sendmail username@example.com < file.txt

Echoing text

echo -e "Subject:<SUBJECT> \n\n <BODY>\n" | sendmail username@example.com