Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #59290

Re: sendmail library ?!

Date 2013-11-13 18:17 +1100
From Cameron Simpson <cs@zip.com.au>
Subject Re: sendmail library ?!
References <52830592.9040108@googlemail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2528.1384327078.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 13Nov2013 05:52, Tamer Higazi <th982a@googlemail.com> wrote:
> I am looking for a python library that does mailing directly through
> "sendmail".
> When I look into the docs, I see only an "smtlip" library but nothing
> that could serve with sendmail or postfix.

Use the subprocess module. Pipe to:

  /usr/sbin/sendmail -oi addr1 addr2 ...

If the exit code is 0, mail dispatched.

This is a trivial function; you don't need a library for this.

Both "sendmail" and "postfix" (and "qmail" et al) provide a "sendmail"
executable for exactly this purpose.

The smtplib is for making arbitrary SMTP operations, thus a whole
module.  Sendmail does all that for you, you only need to deliver
the message to it and ensure it was accepted.

Cheers,
-- 
Cameron Simpson <cs@zip.com.au>

The mere existence of a problem is no proof of the existence of a solution.
        - Yiddish Proverb

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: sendmail library ?! Cameron Simpson <cs@zip.com.au> - 2013-11-13 18:17 +1100

csiph-web