Changes between Initial Version and Version 1 of Ticket #26227, comment 9


Ignore:
Timestamp:
Jul 10, 2018, 8:23:33 PM (6 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26227, comment 9

    initial v1  
    22
    33{{{#!python
     4from django.core.mail import send_mail, EmailMultiAlternatives
    45msg = EmailMultiAlternatives('Subject', 'Body', '...@gmail.com', [ '...@gmail.com'])
    5 msg.attach(u'Имя файла', BytesIO(b'hello word'), 'text/plain')
     6with open('test.txt', 'rb') as fh:
     7    data = fh.read()
     8msg.attach('Имя файла', data, 'text/plain')
    69msg.send()
    710}}}
Back to Top