Sending a mail

Ron Klatchko ron at library.ucsf.edu
Mon Aug 23 15:39:26 EDT 1999


Peter Posselt Vestergaard wrote:
> #!/usr/local/bin/python
> import os
> text='echo "hello"|mailto posselt at daimi.au.dk -s "important message"'
> os.system(text)
> 
> This works quite fine in my python interpreter, but not then I put it on
> the web. I tried to print out the standardoutput from os.system(text)
> and it was 256. Probably my python-server won't allow me to execute that
> command or what? 

Although it's possible that mailto cannot be run by a CGI, before I went
that route I would try using an absolute path for mailto in your command
line.  CGIs tend to have limited environments so it probably doesn't
have the path to mailto.

moo
----------------------------------------------------------------------
          Ron Klatchko - Manager, Advanced Technology Group           
           UCSF Library and Center for Knowledge Management           
                        ron at library.ucsf.edu




More information about the Python-list mailing list