Форум сайта python.su
Всем привет,
в книжке http://cargo.caml.ru/djangobook/ch07s04.html
есть такой код
#from django.core.mail import send_mail
........
send_mail(
'Feedback from your site, topic: %s' % topic,
message, sender,
['vasya_pupkin@mail.ru']
)
from django.core.mail import *
from email.MIMEText import MIMEText
from email import email
topic = 'topic'
msg = MIMEText(message, 'plain', 'utf-8')
msg['From'] = 'robot@dep16.ueip.ru'
msg['To'] = adress
s = smtplib.SMTP()
s.connect(smtp_server)
you = adress
print message
#s.sendmail(me, you, message)
s.sendmail(me, me, msg.as_string())
s.close()
Офлайн
Офлайн