I would like to run a python script via a cron job that sends me a mail

I tried this from the mire.hcoop.net console:
>>> import smtplib
>>> server=smtplib.SMTP('mail.hcoop.net')
>>> server.set_debuglevel(1)
>>> server.sendmail('From: [email protected]\r\n','To: 
>>> [email protected]\r\n\r\n','This is a trial')
send: 'mail FROM:<[email protected]> size=15\r\n'
reply: '250 OK\r\n'
reply: retcode (250); Msg: OK
send: 'rcpt TO:<[email protected]>\r\n'
reply: '250 Accepted\r\n'
reply: retcode (250); Msg: Accepted
send: 'data\r\n'
reply: '354 Enter message, ending with "." on a line by itself\r\n'
reply: retcode (354); Msg: Enter message, ending with "." on a line by itself
data: (354, 'Enter message, ending with "." on a line by itself')
send: 'This is a trial\r\n.\r\n'
reply: '250 OK id=1NLaj5-0002hx-RS\r\n'
reply: retcode (250); Msg: OK id=1NLaj5-0002hx-RS
data: (250, 'OK id=1NLaj5-0002hx-RS')
>>> server.sendmail('From: [email protected]\r\n','To: 
>>> [email protected]\r\n\r\n','This is a trial.\r\n.\r\n')
send: 'mail FROM:<[email protected]> size=21\r\n'
reply: '250 OK\r\n'
reply: retcode (250); Msg: OK
send: 'rcpt TO:<[email protected]>\r\n'
reply: '250 Accepted\r\n'
reply: retcode (250); Msg: Accepted
send: 'data\r\n'
reply: '354 Enter message, ending with "." on a line by itself\r\n'
reply: retcode (354); Msg: Enter message, ending with "." on a line by itself
data: (354, 'Enter message, ending with "." on a line by itself')
send: 'This is a trial.\r\n..\r\n.\r\n'
reply: '250 OK id=1NLake-0002hx-2v\r\n'
reply: retcode (250); Msg: OK id=1NLake-0002hx-2v
data: (250, 'OK id=1NLake-0002hx-2v')
{}


My problem is that I'm not getting any message at all... Is there a
way of configuring the smtp server to send mails? I searched the
mailing list but did not find help there.

Cheers,

Alex

_______________________________________________
HCoop-Help mailing list
[email protected]
https://lists.hcoop.net/listinfo/hcoop-help

Reply via email to