Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
Merge pull request #94 from ulistaerk/ulistaerk-patch-1
Browse files Browse the repository at this point in the history
Open files in binary mode
  • Loading branch information
dstegelman authored Mar 24, 2017
2 parents 1f139f4 + d739917 commit 700bac2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ File attachments can be added to the e-mail with MailerMessage's `add_attachment

message = MailerMessage(to_address="[email protected]", from_address="[email protected]")

photo_one = File(open("Poznan_square.jpg", "r"))
photo_one = File(open("Poznan_square.jpg", "rb"))
message.add_attachment(photo_one)

# …you can add more than one file attachment
photo_two = File(open("Poznan_Malta-lake.jpg", "r"))
photo_two = File(open("Poznan_Malta-lake.jpg", "rb"))
message.add_attachment(photo_two)

message.save()
Expand Down

0 comments on commit 700bac2

Please sign in to comment.