I'm creating a script to receive an email every time someone connects/logs in via SSH to my Linux server. The script is already working, but my issue is with sending the email.
I'm using the following command:
sendemail -f [email protected] -t [email protected] -u "SSH LOGIN TO THE SERVER!" -m "ATTEMPTED LOGIN TO THE SERVER" -s smtp-mail.outlook.com:587 -xu [email protected] -xp PASSWORD`
And I receive the following error:
Jan 17 17:14:10 user sendemail[1700]: ERROR => TLS setup failed: hostname verification failed
I've tried it with port 25 and it returns timeout error:
Jan 17 17:24:59 user sendemail[1711]: ERROR => Timeout while connecting to smtp-mail.outlook.com:25 There was no response after 60 seconds.
I tried with mutt and mailx as well, but it didn't work either...
I'm using an EC2 VM on AWS, and I've opened the ports in the firewall. Anyone know what might be the issue? I tested the same command locally on Ubuntu with the same credentials, and it works, but not on EC2.

sendmailorsendemail??sendemail, so I can't help with your problem :(