Skip to content
Newer
Older
100644 30 lines (21 sloc) 913 Bytes
e7d3f46 @anandology How to send mail using gmail
anandology authored
1 ---
2 layout: default
3 title: How to send mail using gmail
4 ---
5
6 # How to send mail using gmail
7
8 Problem: How to send mail using gmail.
9
10 Solution:
11
12 Often it is tedious to setup and maintain a mail server. If you have a
13 gmail accout, you can use gmail as SMTP server to send mail. To do
14 that we need to specify username and password of gmail account in
15 `web.config`.
16
7525ac8 @anandology How to send mail using gmail
anandology authored
17 web.config.smtp_server = 'smtp.gmail.com'
18 web.config.smtp_port = 587
19 web.config.smtp_username = 'cookbook@gmail.com'
20 web.config.smtp_password = 'secret'
21 web.config.smtp_starttls = True
e7d3f46 @anandology How to send mail using gmail
anandology authored
22
23 Once this configuration is set, `web.sendmail` can be used to send
24 mail using the gmail account. Gmail signs all these mails.
25
8f8e045 @anandology How to send mail using gmail
anandology authored
26 web.sendmail('cookbook@gmail.com', 'user@example.com', 'subject', 'message')
e7d3f46 @anandology How to send mail using gmail
anandology authored
27
28 Read [GMail: Configuring other mail clients][1] for more details.
29
30 [1]: http://mail.google.com/support/bin/answer.py?hl=en&answer=13287
Something went wrong with that request. Please try again.