From f93ea17b4573342a23a8404b1fdd0de75d50cf7e Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Fri, 10 Aug 2018 14:39:43 +0200 Subject: [PATCH] updated readme --- README.md | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e42b103..fd26d19 100644 --- a/README.md +++ b/README.md @@ -3,29 +3,29 @@ Simple tool for sending email with sendmail, postfix or ssmtpd. Example: -{{{ - import pysema - - pysema.send( - ['alice@example.com', 'bob@example.com'], - 'really good subject line', - 'Message body goes here' - ) -}}} +```python +import pysema + +pysema.send( + ['alice@example.com', 'bob@example.com'], + 'really good subject line', + 'Message body goes here' + ) +``` If you need to send some complex message, use [email.message][em] from the Python standard library to construct the message (including header fields) and pass it to the `send_message` function: -{{{ - import pysema - from email.message import EmailMessage - - msg = EmailMessage() - # compose message - - pysema.send_message(msg) -}}} +```python +import pysema +from email.message import EmailMessage + +msg = EmailMessage() +# compose message + +pysema.send_message(msg) +``` if something goes whoopsie a `pysema.SendMailException` is raised.