On Tue, Apr 22, 2008 at 6:06 AM, Stephen Nelson-Smith <<a href="mailto:sanelson@gmail.com">sanelson@gmail.com</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
smtpserver = '<a href="http://relay.clara.net" target="_blank">relay.clara.net</a>'<br>
<br>
RECIPIENTS = ['<a href="mailto:sanelson@gmail.com">sanelson@gmail.com</a>']<br>
SENDER = '<a href="mailto:alerts@atalanta-systems.com">alerts@atalanta-systems.com</a>'<br>
message = """Subject: HTTPD ALERT: %s requests %s connections<br>
Please investigate ASAP.""" % (rps, connections)<br>
<br>
This sends emails....<br>
<br>
But gmail says it came from "unknown sender"</blockquote><div> </div><div>You have to include the From and To headers in the message body as well as passing them to sendmail(). See the example here:<br>
<a href="http://docs.python.org/lib/SMTP-example.html">http://docs.python.org/lib/SMTP-example.html</a><br><br>Kent <br></div></div>