Changes between Version 1 and Version 2 of Ticket #26227, comment 9
- Timestamp:
- Jul 10, 2018, 10:58:26 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26227, comment 9
v1 v2 2 2 3 3 {{{#!python 4 from django.core.mail import send_mail,EmailMultiAlternatives4 from django.core.mail import EmailMultiAlternatives 5 5 msg = EmailMultiAlternatives('Subject', 'Body', '...@gmail.com', [ '...@gmail.com']) 6 with open('test.txt', 'rb') as fh: 7 data = fh.read() 8 msg.attach('Имя файла', data, 'text/plain') 6 msg.attach('Имя файла', b'data', 'text/plain') 9 7 msg.send() 10 8 }}}