Esempio n. 1
0
import smtplib

# Import the email modules we'll need
from email.mime.text import MIMEText
from email.mime.message import MIMEMessage
from email.message import Message
from email.mime.multipart import MIMEMultipart
import email
import seed

seed.createUser('*****@*****.**', 'pass')

html = """\
<html>
  <head></head>
  <body>
    <p>Hi!<br>
       How are you?<br>
       Here is the <a href="http://www.python.org">link</a> you wanted.
    </p>
  </body>
</html>
"""

msg = MIMEText(html, 'html')
msg['Subject'] = 'Subject line here'
msg['From'] = '*****@*****.**'
msg['To'] = '*****@*****.**'

# Send the message via our own SMTP server, but don't include the
# envelope header.
Esempio n. 2
0
# Import smtplib for the actual sending function
import smtplib

# Import the email modules we'll need
from email.mime.text import MIMEText
import email
import seed

seed.createUser('*****@*****.**', 'pass')

# Open a plain text file for reading.  For this example, assume that
# the text file contains only ASCII characters.
# Create a text/plain message
msg = MIMEText("When will you get the server to work?!")

# me == the sender's email address
# you == the recipient's email address
#msg['Subject'] = 'Subject line here'
#msg['From'] = '*****@*****.**'
#msg['To'] = '*****@*****.**'

msg['Subject'] = 'Hey there'
msg['From'] = 'Thatcher <*****@*****.**>'
msg['To'] = '*****@*****.**'


# Send the message via our own SMTP server, but don't include the
# envelope header.
#s = smtplib.SMTP('smtp.mailreceipts.com',587)
s = smtplib.SMTP('localhost',2501)