473,406 Members | 2,451 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,406 software developers and data experts.

Python for email?

Is there a good module for sending out email?

For a website that I am working on, I am writing a program that finds out
which presenters have not yet confirmed their scheduled date and sends them
an email to confirm.

Does python have any modules for use with mail programs like sendmail, or
should I just run everything with os.system and os.popen?

Thanks for any help.
Jul 18 '05 #1
10 1995
On Fri, 26 Mar 2004 17:16:29 -0800, sean wrote:
Is there a good module for sending out email?

For a website that I am working on, I am writing a program that finds out
which presenters have not yet confirmed their scheduled date and sends them
an email to confirm.

Does python have any modules for use with mail programs like sendmail, or
should I just run everything with os.system and os.popen?

Thanks for any help.


Check out smtplib, it should do what you want

Good Luck,
Brett

Jul 18 '05 #2

sean> Is there a good module for sending out email?

Check out smtplib in the standard library:

http://www.python.org/doc/current/li...e-smtplib.html

Skip

Jul 18 '05 #3
In article <ma************************************@python.org >,
Skip Montanaro <sk**@pobox.com> wrote:

sean> Is there a good module for sending out email?

Check out smtplib in the standard library:

http://www.python.org/doc/current/li...e-smtplib.html

Skip


'Past time that I mention this: I'm a big fan of the smtplib module.
In general, I think this is the direction Python-oriented developers
should take, and NOT to "shell out" to sendmail or such. However,
one benefit of sendmail and comparable MTAs that's often not immedi-
ately apparent (and, with any luck, won't be for the life of any
specific project) is their knowledge about retries. Projects that
face erratic connectivity either need to exploit an installed MTA,
or program their own retry management.

smtplib presents a few other, even more marginal issues. If an
installed MTA enforces institutional standards (disclaimers, archi-
ving, ...), smtplib is likely to subvert those. Decide for yourself
if that's a good or bad thing.
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net
Jul 18 '05 #4
cl****@lairds.com (Cameron Laird) writes:
smtplib presents a few other, even more marginal issues. If an
installed MTA enforces institutional standards (disclaimers, archi-
ving, ...), smtplib is likely to subvert those.


How so?

The example for smtplib given here
http://www.python.org/doc/current/lib/SMTP-example.html
appears to relay mail through "localhost". That will typically be
equivalent to using the "installed MTA", right?

--kyler
Jul 18 '05 #5
In article <mq************@snout.lairds.org>,
Kyler Laird <Ky***@news.Lairds.org> wrote:
cl****@lairds.com (Cameron Laird) writes:
smtplib presents a few other, even more marginal issues. If an
installed MTA enforces institutional standards (disclaimers, archi-
ving, ...), smtplib is likely to subvert those.


How so?

The example for smtplib given here
http://www.python.org/doc/current/lib/SMTP-example.html
appears to relay mail through "localhost". That will typically be
equivalent to using the "installed MTA", right?

--kyler


All true, and by neglecting to read the manual recently, I've
confused things. Thanks for the correction.

*I* have the habit of doing something that I now see the smtplib
documentation does not recommend--'fact, I now suspect that it
never did, and that it's my own memory that introduced all the
problems. Here's what I should have written before:
smtplib is great. If you get in the habit of using
it to connect directly to the far endpoint, as I do,
you risk the surprise of finding situations where a
local MTA is an advantage. In any case, though,
smtplib can always be configured do at least as much
for you as shelling out to a local mailer.
--

Cameron Laird <cl****@phaseit.net>
Business: http://www.Phaseit.net
Jul 18 '05 #6
"sean" <se********@cox.net> wrote in message news:<SB49c.47641$Bg.20541@fed1read03>...
Is there a good module for sending out email?

For a website that I am working on, I am writing a program that finds out
which presenters have not yet confirmed their scheduled date and sends them
an email to confirm.

Does python have any modules for use with mail programs like sendmail, or
should I just run everything with os.system and os.popen?

Thanks for any help.


.... and using imaplib, you could *listen* to an email account for
confirmations and thus, know if the confirm info as reached the
presenters brain !-)

jean-marc
Spring is in the air
Jul 18 '05 #7
Thanks you all for the info. That is exacly what I was looking for.
"jmdeschamps" <jm*********@cvm.qc.ca> wrote in message
news:3d**************************@posting.google.c om...
"sean" <se********@cox.net> wrote in message

news:<SB49c.47641$Bg.20541@fed1read03>...
Is there a good module for sending out email?

For a website that I am working on, I am writing a program that finds out which presenters have not yet confirmed their scheduled date and sends them an email to confirm.

Does python have any modules for use with mail programs like sendmail, or should I just run everything with os.system and os.popen?

Thanks for any help.


... and using imaplib, you could *listen* to an email account for
confirmations and thus, know if the confirm info as reached the
presenters brain !-)

jean-marc
Spring is in the air

Jul 18 '05 #8
Quoth cl****@lairds.com (Cameron Laird):
| ... Here's what I should have written before:
| smtplib is great. If you get in the habit of using
| it to connect directly to the far endpoint, as I do,
| you risk the surprise of finding situations where a
| local MTA is an advantage. In any case, though,
| smtplib can always be configured do at least as much
| for you as shelling out to a local mailer.

Of course there's no guarantee that a connection to localhost
is going to work, either - not all hosts accept incoming mail.
But it probably isn't a great idea to try to send it right to
the recipient's doorstep, especially if you're not prepared to
look up DNS MX records.

Some sites provide a host just for this purpose, for use by
desktop mail software and other similar applications.

Donn Cave, do**@drizzle.com
Jul 18 '05 #9
cl****@lairds.com (Cameron Laird) writes:
However, one benefit of sendmail and comparable MTAs that's often
not immedi- ately apparent (and, with any luck, won't be for the
life of any specific project) is their knowledge about retries.


A good argument against MTAs when doing an application for deployment
with less than knowledgable sysadmins that pick a default linux box
and do an install just to get your system up on running on their
intranet.

When their email doesn't work for one of a myriad of reasons (FQDN,
relay configuration, odd internal MX records) you're left supporting
them or telling them to find support for some piece of software more
complex than what you probably gave them.

I got reminded of this yet again when I tried to do a VERY quick
install of bugzilla a few months ago.

Getting them to enter an IP and then on the phone telling them to do
telnet host 25 is a much easier thing to debug.
--
Chris Green <cm*@dok.org>
A good pun is its own reword.
Jul 18 '05 #10
Hi all,

I have a very primitive question about Python & COM interface.
As of now I have not got any good documentation on using it.
I am planning to buy Python programming on win32 book.
[ It will reach me only after 2 days :-( ]

Could some one please suggest how to add one COM interface which takes
int array as input.
precisely I want to do following

a=[]
a.append(100)
a.append(200)

from win32com.client import Dispatch
o=Dispatch("MyAppl.com")
o.setIntArray(len(a),a)
I am expecting in my COM interface, I will get VARIENT of SAFEARRAY .

in ATL com implementation,
SAFEARRAY *array=V_ARRAY(a);
long i,val;
for(i=0;i<len;i++){
SafeArrayGetElement(array,&i,&val)
c_array[i]= val;
}

I am not getting proper values in C array.
Any suggestions?

Regards,
Anand

Jul 18 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 240 open ( -1) / 2655 closed (+15) / 2895 total (+14) Bugs : 766 open ( +0) / 4514 closed (+22) / 5280 total (+22) RFE : 155 open...
3
by: fdsl ysnh | last post by:
--- python-list-request@python.orgдµÀ: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, > visit >...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.