I was using gmail smtp with PHP application for a long time and now they stopped the smtp .
After looking for a solution for a some time, I found this easy way. ( not sure whether its the easiest way, ping me if not )
I used raspberry pi 4 with LAMP for testing.
- How to install LAMP on raspberry pi
- Install sSMTP
- Remove any previous mail palcakge
- service sendmail stop
- service postfix stop
- sudo apt-get remove sendmail
- sudo apt-get remove postfix
- Remove any previous mail palcakge
- Install sSMTP
- sudo apt-get install ssmtp
- nano /etc/ssmtp/ssmtp.conf

For me the free quota from elasticemail is more than enough.
It’s now ready for testing
<?php
$message = "Hi, how are you doing?";
mail('youremail@domain.com', 'Email Subject', $message);
?>
Check the log for any errors
tail -f /var/log/mail.log
Following sites were updated with LAMP+sSMTP message sending functionality ( http://buminda.com & http://buminda.com.au )
