Difference between revisions of "Python/Smtplib"

From ProgrammingExamples
Jump to: navigation, search
(SmtpLibrary.py)
(SmtpLibrary.py)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==SmtpLibrary.py==
 
==SmtpLibrary.py==
 +
[[Python|<font size='-2'>''back to Python examples''</font>]]
 +
----
 
<source lang="python">
 
<source lang="python">
 
import smtplib
 
import smtplib
Line 11: Line 13:
  
 
s.quit()
 
s.quit()
</source>
+
</source><br>
 +
----
 +
[[Python|<font size='-2'>''back to Python examples''</font>]]

Latest revision as of 09:27, 27 June 2010

SmtpLibrary.py

back to Python examples


import smtplib
 
 
s = smtplib.SMTP('smtp.gmail.com', 587)
s.starttls()
 
s.login("example@gmail.com", "password12345")
s.sendmail("example@gmail.com", "recipient@address.com", "Hello, this is the message")
 
s.quit()


back to Python examples