[Django] #20827: Email sending bug

2 views
Skip to first unread message

Django

unread,
Jul 30, 2013, 6:34:24 AM7/30/13
to django-...@googlegroups.com
#20827: Email sending bug
---------------------------------+---------------------------
Reporter: ashley.faqihi@… | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.5
Severity: Normal | Keywords: email sending
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+---------------------------
In the Preventing header injection section of sending Email, the example
below imports send_email and defines a send_email function to call
send_email:

from django.core.mail import send_mail, BadHeaderError

def send_email(request):
subject = request.POST.get('subject', '')
message = request.POST.get('message', '')
from_email = request.POST.get('from_email', '')
if subject and message and from_email:
try:
send_mail(subject, message, from_email, ['ad...@example.com'])
except BadHeaderError:
return HttpResponse('Invalid header found.')
return HttpResponseRedirect('/contact/thanks/')
else:
# In reality we'd use a form class
# to get proper validation errors.
return HttpResponse('Make sure all fields are entered and valid.')

--
Ticket URL: <https://code.djangoproject.com/ticket/20827>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jul 30, 2013, 7:03:08 AM7/30/13
to django-...@googlegroups.com
#20827: Email sending bug
---------------------------------+--------------------------------------
Reporter: ashley.faqihi@… | Owner: nobody
Type: Bug | Status: closed
Component: Documentation | Version: 1.5
Severity: Normal | Resolution: invalid

Keywords: email sending | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Changes (by timo):

* status: new => closed
* needs_docs: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_better_patch: => 0


Comment:

The imported function is `send_mail` (no e).

--
Ticket URL: <https://code.djangoproject.com/ticket/20827#comment:1>

Reply all
Reply to author
Forward
0 new messages