1st time I have hit this and I am confused the subject error is returned as in the send_mail line all the fields in the model are either CharField or TextField
settings.py DEFAULT_FROM_EMAIL = '[email protected]' ---- valid email address CONTACT_EMAIL_TO = '[email protected]' ---- valid email address views.py class QuestionForm(ModelForm): class Meta: model = AskQuestion def question(request): if request.POST: form = QuestionForm(request.POST) if form.is_valid(): name = form.cleaned_data['name'] telephone = form.cleaned_data['telephone'] email = form.cleaned_data['email'] question = form.cleaned_data['question'] new = form.save() msg_header = "A Question has been asked.\n\n" msg_middle = "Name: %s\n\n" % form.cleaned_data['name'] msg_middle += "Telephone: %s\n\n" % form.cleaned_data['telephone'] msg_middle += "Email: %s\n\n" % form.cleaned_data['email'] msg_middle += "Question: %s\n\n" % form.cleaned_data['question'] send_mail(settings.EMAIL_SUBJECT_PREFIX +"Email from the question form", msg_header+msg_middle, settings.DEFAULT_FROM_EMAIL [settings.CONTACT_EMAIL_TO], fail_silently=False) return HttpResponseRedirect('/question-response/') else: form = QuestionForm(request.POST) else: form = QuestionForm() try: exsp = SmartPage.objects.get(slug='question-form') except SmartPage.DoesNotExist: exsp = None return render_to_repsonse("index.html", {'form': form, 'exsp': exsp,}, context_instance=RequestContext(request)) -- View this message in context: http://old.nabble.com/string-indices-must-be-integers%2C-not-str-tp32871097p32871097.html Sent from the django-users mailing list archive at Nabble.com. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

