Skip to content

Eloco/sendmail-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sendmail-flask

sendmail by flask api

Currently only supports SSL PORT for mail_server ( Gmail SMTP port (SSL): 465)

optional for env:

  • ${MAIL_USER} default is None
  • ${MAIL_PASS} default is None
  • ${MAIL_SERVER} default is smtp.gmail.com
  • ${MAIL_PORT} default is 465

POST vaule:

necessary

- receiver    , default = ""                     (receiver mail address)
- mail        , default = {env.MAIL_USER}      (sender mail address)
- pass        , default = {env.MAIL_PASS}      (sender mail pass)
- server      , default = {env.MAIL_SERVER}    (sender mail server)
- port        , default = {env.MAIL_PORT}      (sender mail port)

optional

- subject     , default = "default subject"      (mail subject)
- message     , default = "hello world [Default]"(mail body) [Base64 or plain text]
- attach_link , default = ""                     (only one attachment in a link) 
- Bcc         , default = ""                     (mail blind carbon copy address)
- cc          , default = ""                     (mail carbon copy address)

example using httpie

  1. simple use
http -f POST http{s}://{ip or hostname}:{port}/send receiver="[email protected],[email protected]" \
                                                    subject="hello subject" \
                                                    body="hello body"
  1. cc , bcc and send a attachment
http -f POST http{s}://{ip or hostname}:{port}/send receiver="[email protected]" \
                                                     cc="[email protected]" \ 
                                                     Bcc="[email protected]" \
                                                     attach_link="https://transfer.sh/T3y2FO/hello.txt"
  1. use own smtp mail
http -f POST http{s}://{ip or hostname}:{port}/send receiver="[email protected],[email protected]" \
                                                       mail="[email protected]" \
                                                       pass="xxx" \
                                                       server="smtp.gmail.com"
                                                       port="465"

hint (how to get Gmail SMTP pass)

Time flies, the way I do without enabling less secured app is making a password for specific app

After this, use the sixteen digits password as mail SMTP password, enjoy!

funny (mail to sms)

only support us and ca phone number

About

sendmail by flask api

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published