smtp delivery banner - unable to send mails via outlook

Solution 1:

Please extend your question with your platform details (distribution, version, ssmtp version, where did you installed from, etc.).

Regarding your config file:

/etc/ssmtp/ssmtp.conf

A few issues I see (which might or might not apply, depending on version):

  1. The hostname should have a FQDN (fully qualified domain name), else Outlook (or Gmail, Yahoo and others) might reject it. You could try adding one.
  2. You seem to be missing "AuthMethod".
  3. Some say that UseTLS and UseSTARTTLS exclude each other, others place both settings. You could try swaping between those options.

Example:

[email protected]
FromLineOverride=YES    # usually goes with root
mailhub=smtp-mail.outlook.com:587
rewriteDomain=outlook.com    # shouldn't be needed if you are not overwriting from, but doesn't hurt
[email protected]
AuthPass=mypassword
AuthMethod=LOGIN             # could be plain or cram-md5 for ex. 
UseTLS=Yes                   # this one might be yes or no
UseSTARTTLS=Yes 
hostname=sierra-test.domain.com  # full domain here, might help

You do have to keep in mind that if you enabled 2FA (two factor authentication) for you email/account, you will need to validate it before it allows you to send email.

Solution 2:

It would be easier to debug the problem if you can provide more verbose output. Use the following to get the verbose output:

echo -e "Subject:Hello \n\n I would like to buy a hamburger\n" | sendmail -v <RECEIPIENT>

However, since you have mentioned outlook in your question, the most notorious problem with outlook is mismatching the username on the local Linux machine and the username on the server.

For example:

  • On your local machine echo $USER gives the value firstname
  • While your email username is [email protected]

This can be solved by specifying the user information into the command flags, try out the following:

echo -e "Subject:Hello \n\n I would like to buy a hamburger\n" | sendmail -v <RECEIPIENT> -f<firstname.lastname>