{"action":"created","issue":{"url":"https://api.github.com/repos/aspineux/pyzmail/issues/7","labels_url":"https://api.github.com/repos/aspineux/pyzmail/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/aspineux/pyzmail/issues/7/comments","events_url":"https://api.github.com/repos/aspineux/pyzmail/issues/7/events","html_url":"https://github.com/aspineux/pyzmail/issues/7","id":71485791,"number":7,"title":"Documentation: some more examples for common use cases (adding extra headers)","user":{"login":"lbeltrame","id":25192,"avatar_url":"https://avatars.githubusercontent.com/u/25192?v=3","gravatar_id":"","url":"https://api.github.com/users/lbeltrame","html_url":"https://github.com/lbeltrame","followers_url":"https://api.github.com/users/lbeltrame/followers","following_url":"https://api.github.com/users/lbeltrame/following{/other_user}","gists_url":"https://api.github.com/users/lbeltrame/gists{/gist_id}","starred_url":"https://api.github.com/users/lbeltrame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbeltrame/subscriptions","organizations_url":"https://api.github.com/users/lbeltrame/orgs","repos_url":"https://api.github.com/users/lbeltrame/repos","events_url":"https://api.github.com/users/lbeltrame/events{/privacy}","received_events_url":"https://api.github.com/users/lbeltrame/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-28T05:38:52Z","updated_at":"2015-04-29T18:57:55Z","closed_at":null,"body":"I'm opening this as an issue so it's tracked. In particular, it would be nice to have in the docs some indication on how to add extra headers for common operations like ``Disposition-Notification-To``. I had to hunt down the API docs and I couldn't quite get them to work (malformed email addresses). \r\n\r\nSo, a little example in the documentation would help a lot."},"comment":{"url":"https://api.github.com/repos/aspineux/pyzmail/issues/comments/97540740","html_url":"https://github.com/aspineux/pyzmail/issues/7#issuecomment-97540740","issue_url":"https://api.github.com/repos/aspineux/pyzmail/issues/7","id":97540740,"user":{"login":"lbeltrame","id":25192,"avatar_url":"https://avatars.githubusercontent.com/u/25192?v=3","gravatar_id":"","url":"https://api.github.com/users/lbeltrame","html_url":"https://github.com/lbeltrame","followers_url":"https://api.github.com/users/lbeltrame/followers","following_url":"https://api.github.com/users/lbeltrame/following{/other_user}","gists_url":"https://api.github.com/users/lbeltrame/gists{/gist_id}","starred_url":"https://api.github.com/users/lbeltrame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbeltrame/subscriptions","organizations_url":"https://api.github.com/users/lbeltrame/orgs","repos_url":"https://api.github.com/users/lbeltrame/repos","events_url":"https://api.github.com/users/lbeltrame/events{/privacy}","received_events_url":"https://api.github.com/users/lbeltrame/received_events","type":"User","site_admin":false},"created_at":"2015-04-29T18:57:55Z","updated_at":"2015-04-29T18:57:55Z","body":"I disagree: I followed the API docs, yet it generated a completely wrong header for Disposition-Notification-To.\r\n\r\nCode:\r\n\r\n````python\r\n\r\nformatted_receipt_addr = format_addresses(\r\n    ['name.surname@example.org'],\r\n    \"Disposition-Notification-To\",\r\n    \"utf-8\").encode()\r\n\r\nextra_headers = [(\"Disposition-Notification-To\", formatted_receipt_addr)]\r\n\r\n# later on... ENCODING is utf-8\r\nmail_structure = compose_mail(sender, recipients, subject, ENCODING,\r\n                                  (text, ENCODING), html=None,\r\n                                  attachments=attachments,\r\n                                  headers=extra_headers,\r\n                                  bcc=bcc)\r\n\r\n````\r\n\r\nHowever this creates a completely wrong header:\r\n\r\n````\r\nDisposition-Notification-To: =?utf-8?q?name=2Esurnamei=40example=2Eorg?@server.hostname.example.org\r\n````\r\nI likely did something wrong, but I just followed the API docs.\r\n"}}