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


Ignore:
Timestamp:
Jul 10, 2018, 10:58:26 PM (6 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26227, comment 9

    v1 v2  
    22
    33{{{#!python
    4 from django.core.mail import send_mail, EmailMultiAlternatives
     4from django.core.mail import EmailMultiAlternatives
    55msg = 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')
     6msg.attach('Имя файла', b'data', 'text/plain')
    97msg.send()
    108}}}
Back to Top