Go to file
2021-06-15 15:36:16 +03:00
.gitignore Initial commit 2021-06-14 08:50:35 +03:00
LICENSE Initial commit 2021-06-14 08:50:35 +03:00
README.md add description sendmail.py 2021-06-15 15:36:16 +03:00
sendmail.py add sendmail.py 2021-06-15 13:30:14 +03:00

utils


sendmail.py

PARAMETERS DESCRIPTION DEFAULT
-u, --user smtp valid user REQUIRED
-p, --pass smtp valid password REQUIRED
-d, --dest destination addresses REQUIRED
[-h] print help and exit
[--smtp] smtp hostname or ip address smtp.gmail.com
[--port] smtp port number 587
[--stls] smtp required TLS True
[--from] mail from alias --user value
[--subj] mail subject 'no subject'
[--text] mail body text 'no text'
[--type] mail body type: plain, html plain
[--file] mail attachment files None
Example usage in terminal with Python:
python3 ./sendmail.py -u user@gmail.com -p pass -d addr1@gmail.com,addr2@gmail.com

Example usage in terminal with make the script executable:

chmod u+x ./sendmail.py
./sendmail.py -u user@gmail.com -p pass -d addr1@gmail.com,addr2@gmail.com

Example usage in Python:

from sendmail import Mail

msg = Mail(smtp_user='user@gmail.com', smtp_pass='pass', mail_dest='addr1@gmail.com,addr2@gmail.com')
log = msg.send()
print(log)