This was only tested for gmail, other email servers might not work

for gmail you'll have to generate a unique app password from your google account to permit the script to send emails