471,852 Members | 821 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,852 software developers and data experts.

SMTP question

I'm trying to send an email this way:
msg = MIMEText(self.text_ctrl_1.GetValue())
msg['Subject'] = sub
msg['From'] = 'b*************@yahoo.com'
msg['To'] = to
s = smtplib.SMTP('smtp.mail.yahoo.com')
s.set_debuglevel(1)
s.connect()
s.sendmail('b*************@yahoo.com', to, msg)
s.quit()
but this is not working at all. Can someone point me in the right direction?
Jul 18 '05 #1
4 1239
I'm trying to send an email this way:
msg = MIMEText(self.text_ctrl_1.GetValue())
msg['Subject'] = sub
msg['From'] = 'b*************@yahoo.com'
msg['To'] = to
s = smtplib.SMTP('smtp.mail.yahoo.com')
s.set_debuglevel(1)
s.connect()
s.sendmail('b*************@yahoo.com', to, msg)
s.quit()


smtplib.SMTP.sendmail takes:
(sender, [recipient1, recipient2,...], message)

Make the second to the last line:
s.sendmail('b*************@yahoo.com', [to], msg)

And it should work (if you are allowed to send outgoing through
smtp.mail.yahoo.com)

You should also call s.close(), just to be sure.

- Josiah

Jul 18 '05 #2
To Josiah, sorry you're getting this twice, didn't realize you responded both
in the mailgroup, and by email. But to others, that didn't help, well, it did
as far as me formating for a list, but I'm still not getting into Yahoo. For
my smtp server smtp.mail.yahoo.com, I just pasted directly from my Outlook
settings which have always worked fine. When I use s.login('bossierbossman',
'password') I get something like SMTP AUTH extension not supported by server,
and when I just have s.connect() I get socket.error: (10061, 'Connection
refused')
Jul 18 '05 #3
LutherRevisited a écrit :
I'm trying to send an email this way:
msg = MIMEText(self.text_ctrl_1.GetValue())
msg['Subject'] = sub
msg['From'] = 'b*************@yahoo.com'
msg['To'] = to
s = smtplib.SMTP('smtp.mail.yahoo.com')
s.set_debuglevel(1)
s.connect()
s.sendmail('b*************@yahoo.com', to, msg)
s.quit()
but this is not working at all. Can someone point me in the right direction?


Have a look at the email package that provides features for building
easily RFC822 compliant mail headers and bodies (including multipart).

--
Gilles
Jul 18 '05 #4
Lad
lu*************@aol.com (LutherRevisited) wrote in message news:<20***************************@mb-m03.aol.com>...
To Josiah, sorry you're getting this twice, didn't realize you responded both
in the mailgroup, and by email. But to others, that didn't help, well, it did
as far as me formating for a list, but I'm still not getting into Yahoo. For
my smtp server smtp.mail.yahoo.com, I just pasted directly from my Outlook
settings which have always worked fine. When I use s.login('bossierbossman',
'password') I get something like SMTP AUTH extension not supported by server,
and when I just have s.connect() I get socket.error: (10061, 'Connection
refused')


I also had a problem to find a mail server that could relay my emails.
So I do it this way: for a recepient's address I find his mailserver
and send the email directly to it. No need to have a mail server
LAd
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by ehendrikd | last post: by
2 posts views Thread by Dan Boyle | last post: by
4 posts views Thread by Philippe C. Martin | last post: by
5 posts views Thread by Charlie | last post: by
1 post views Thread by Nigel | last post: by
5 posts views Thread by trevisc | last post: by
NeoPa
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.