Permalink
Browse files

Merge pull request #77 from gautamjeyaraman/master

Updated email demo to demonstrate add_header
  • Loading branch information...
2 parents c1d6952 + 883ea09 commit 7b2a9ba76c37b1b5995779e0b0c1dff06fece89b @fiorix committed Nov 16, 2012
Showing with 7 additions and 1 deletion.
  1. +4 −0 README.rst
  2. +1 −1 cyclone/mail.py
  3. +2 −0 demos/email/emaildemo.py
View
4 README.rst
@@ -676,3 +676,7 @@ Thanks to (in no particular order):
- `Flavio Grossi <https://github.com/flaviogrossi>`_
- Minor code fixes and websockets chat statistics example
+
+- `Gautam Jeyaraman <https://github.com/gautamjeyaraman>`_
+
+ - Minor code fixes and patches
View
2 cyclone/mail.py
@@ -65,7 +65,7 @@ def attach(self, filename, mime=None, charset=None, content=None):
part.set_payload(content)
Encoders.encode_base64(part)
part.add_header("Content-Disposition",
- 'attachment; filename="%s"' % base)
+ "attachment", filename=base)
if mime is not None:
part.set_type(mime)
View
2 demos/email/emaildemo.py
@@ -75,6 +75,8 @@ def post(self):
msg.attach("fake.txt", mime="text/plain", charset="utf-8",
content="this file is fake!")
+ msg.add_header('X-MailTag', 'sampleUpload') # custom email header
+
try:
response = yield cyclone.mail.sendmail(
self.settings.email_settings, msg)

0 comments on commit 7b2a9ba

Please sign in to comment.