Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 784f1424e1
Fetching contributors…

Cannot retrieve contributors at this time

42 lines (37 sloc) 1.347 kb
# -*- coding:utf-8 -*-
from datetime import datetime
from email.mime.multipart import MIMEMultipart
import random
import smtplib
# Import the email modules we'll need
from email.mime.text import MIMEText
from time import sleep
from dialect import translate
def send(link):
# Open a plain text file for reading. For this example, assume that
# the text file contains only ASCII characters.
f = open('mail.html', 'rb')
html =
# Create a text/plain message
msg = MIMEMultipart('alternative')
msg['Subject'] = "Hello Marathoner!"
msg['From'] = ' Aleksei Marathon Mail'
msg['To'] = ''
html += 'Вот тебе линк на <a href="%s">марафон</a>' % (link)
part1 = MIMEText(html, 'html')
# Send the message via our own SMTP server, but don't include the
# envelope header.
s = smtplib.SMTP('***', port=465)
s.login('***', '***')
s.sendmail('***', ['***'], msg.as_string())
if __name__ == '__main__':
while True:
links = translate(' ')
link = links[random.randint(0, len(links))]
print 'sent on %s' % (str(datetime.utcnow()))
secs = random.randint(0 * 3600, 3 * 3600)
Jump to Line
Something went wrong with that request. Please try again.