Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 913 Bytes

sendmail_with_gmail.md

File metadata and controls

30 lines (21 loc) · 913 Bytes
layout title
default
How to send mail using gmail

How to send mail using gmail

Problem: How to send mail using gmail.

Solution:

Often it is tedious to setup and maintain a mail server. If you have a gmail accout, you can use gmail as SMTP server to send mail. To do that we need to specify username and password of gmail account in web.config.

web.config.smtp_server = 'smtp.gmail.com'
web.config.smtp_port = 587
web.config.smtp_username = '[email protected]'
web.config.smtp_password = 'secret'
web.config.smtp_starttls = True

Once this configuration is set, web.sendmail can be used to send mail using the gmail account. Gmail signs all these mails.

web.sendmail('[email protected]', '[email protected]', 'subject', 'message')

Read GMail: Configuring other mail clients for more details.