Opened 18 years ago
Closed 18 years ago
#5042 closed (worksforme)
misleading documentation
| Reported by: | anonymous | Owned by: | Jacob |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Keywords: | EmailMultiAlternatives | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The example script for EmailMultiAlternatives at http://www.djangoproject.com/documentation/email/ is incorrect.
You need to surround the to with [], otherwise you get an error can't add a string to a list.
from django.core.mail import EmailMultiAlternatives subject, from_email, to = 'hello', 'from@example.com', 'to@example.com' text_content = 'This is an important message.' html_content = '<p>This is an <strong>important</strong> message.' msg = EmailMultiAlternatives(subject, text_content, from_email, to) msg.attach_alternative(html_content, "text/html") msg.send()
Change History (2)
comment:1 by , 18 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 18 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
I cannot replicate this problem.
Note:
See TracTickets
for help on using tickets.
Fixed formatting in description.