Sending a mail

Peter Posselt Vestergaard posselt at daimi.au.dk
Mon Aug 23 18:01:15 CEST 1999


Hi.
I want my script to send a mail with a specific subject. I've tried to
import and use the smtplib, but I get the message that it doesn't exist
- maybe it isn't implemented on the server I'm using, and anyway - I
can't specify a subject using the sendmail()-command...
Then I tried to use the os.system like follows:

#!/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? I hope that anyone knows some kind of workaround, or
another way to do this???
Best regards
Peter Posselt Vestergaard




More information about the Python-list mailing list