473,394 Members | 1,845 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 1280
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ehendrikd | last post by:
hi all i have written a php site that uses the mail() on windows and i had to state in the php.ini file which smtp server to use. have now migrated this site to a redhat 9 server, but i still...
2
by: Dan Boyle | last post by:
Hi, I am having difficulty connection to an smtp host. I am using the following code but I don't think I fully understand what smtp host can be used. function setSMTPParams($host = null,...
21
by: Nancy | last post by:
Hi, Guys, Is there any other way to use python or mod_python writing a web page? I mean, not use "form.py/email", no SMTP server. <form action="form.py/email" method="POST"> ... Thanks a lot. ...
4
by: Philippe C. Martin | last post by:
Hi, I am testing the smtp module and have the following question: in the code below (taken from net sample) prior to adding the "Subject:" field, the email client found the "From" and the...
5
by: Charlie | last post by:
Hi: I'm working on an e-commerce site. Using the SMTP class, my site sends out confirmation messages. It works most of the time, but sometimes raises an error. I need a way of making sure it...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
1
by: Nigel | last post by:
I know there are lots of threads covering my question but i am still unable to send e-mails from an asp.net page. Messages are not even going into the logs. Here is the code that i am using to...
6
by: Dushyant | last post by:
Hi everyone, I am working on an application, where I need to mail some xml files as attachments. I tried to use System.Diagnostic.Process class but it does not provide any help for attaching a...
5
by: trevisc | last post by:
Good afternoon everyone. I'm currently trying to build an automated invoice system that collects dynamic data and automatically sends out invoices. In my test database I have 23 companies that...
6
by: phpmagesh | last post by:
Hi, I am using mail function in my php page, As soon i update the details, i have to send mail to the customer with the updated details, problem is when i send mail it simple through waring msg...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.