apt-get install libio-socket-ssl-perl libnet-ssleay-perl sendemail
sendemail -f fromuser@gmail.com -t touser@domain.com -u subject -m "message" -s smtp.gmail.com:587 -o tls=yes -xu gmailaccount@gmail.com -xp gmailpassword
Buoc 1:
sudo apt install sendemail
Buocs 2:
sendemail -f phamngoctuong1805@gmail.com -t phamngoctuong1805@gmail.com -u subject -m "message" -s smtp.gmail.com:587 -o tls=yes -xu phamngoctuong1805@gmail.com -xp lufcvcbdnbjcrvta
mail( 'phamngoctuong1805@gmail.com', 'Works!', 'An email has been generated from your localhost, congratulations!')
Thử trực tiếp nhưng chưa được
sendmail -f phamngoctuong1805@gmail.com -t phamngoctuong1805@gmail.com -u subject -m "message" -s smtp.gmail.com:587 -o tls=yes -xu phamngoctuong1805@gmail.com -xp lufcvcbdnbjcrvta