Send email from you Ask app
Ask has a built in tool for sending email messages. You just have to configure it to use an SMTP server (e.g. Gmail) and you're good to go.
Setup/Configuration
You configure the mail tool from your projects Askfile. In this example we're connecting to gmail.
[mail]
debug=true
server='smtp.gmail.com'
port=465
use_tls=false
use_ssl=true
username=''
password=''
The Mail Class
All functions and events related to emails are available under built-in the mail
class.
Example App
@get('/email'):
msg = mail.msg('Subject line', ['recipient@gmail.com'], 'Message body.')
mail.send(msg)
Last updated