problem with sending email
lekatsas at EE.Princeton.EDU
Tue Jul 3 07:54:08 CEST 2001
This works thanks!
Unfortunately it makes my scripts less portable as the path to
sendmail has to be specified (not always at /usr/sbin/sendmail)
but this seems to be the only solution I have so far.
I wonder if python's smtplib is broken.
> On Tue, 3 Jul 2001, Haris Lekatsas wrote:
> > How can I do that from a CGI script?
> One way:
> os.system("""/usr/sbin/sendmail -t << EOMESSAGE
> From: %(from)s
> To: %(towhom)s
> Subject: %(subject)s
> EOMESSAGE""" % vars())
> Another way is to open sendmail thru the pipe:
> file = os.popen("/usr/sbin/sendmail -t", "w")
> > In article <mailman.994069322.26388.python-list at python.org>, Roman Suzi says...
> > >
> > >On 2 Jul 2001 piet at cs.uu.nl wrote:
> > >
> > >> >>>>> Haris Lekatsas <nospam at newsranger.com> (HL) writes:
> > >>
> > >> HL> I have a problem running the script below on FreeBSD. When I run it from the
> > >> HL> UNIX prompt it runs fine and it sends a file (bigtextfile) of any size to
> > >> HL> the recipient address. Whenever a run the exact same script from a web
> > >> HL> browser as a CGI script it will send only about 17K of the bigfile and not
> > >> HL> the whole thing. I tried many different files and all of them get cut off
> > >> HL> at around 17K. It seems on other OS this problem does not appear. Any ideas
> > >> HL> why this is happening would be appreciated.
> > >
> > >What if you try to send mail by piping to "sendmail -t"?
> > >
> > >Sincerely yours, Roman A.Suzi
> > >--
> > > - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
> Sincerely yours, Roman A.Suzi
> - Petrozavodsk - Karelia - Russia - mailto:rnd at onego.ru -
More information about the Python-list