Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #settings
- EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
- EMAIL_HOST_USER = '---'
- EMAIL_HOST_USERNAME = ''
- EMAIL_HOST_PASSWORD = ''
- EMAIL_PORT = 25
- EMAIL_USE_TLS = False
- def contact(request):
- title = "Content"
- form = contactForm(request.POST or None)
- context = {'title': title, 'form': form,}
- if form.is_valid():
- name = form.cleaned_data['name']
- comment = form.cleaned_data['comment']
- subject = "Thanks"
- message = "%s %s" % (comment, name)
- emailTo = [form.cleaned_data['email']]
- emailFrom = settings.EMAIL_HOST_USER
- send_mail(
- subject,
- message,
- emailFrom,
- emailTo,
- fail_silently=False,
- )
- title = "Thanks"
- confirm_message = "Thanks for the message. We will get right back to you."
- template = "contact.html"
- return render(request,template,context)
- -------------------------------------------------------------------------------
- [08/Feb/2017 07:53:13] "POST /contact/ HTTP/1.1" 200 7666
- MIME-Version: 1.0
- Content-Type: text/plain; charset="utf-8"
- Content-Transfer-Encoding: 7bit
- Subject: #subject
- From: #host address
- To: #receiver address
- Date: Wed, 08 Feb 2017 07:53:20 -0000
- Message-ID: <-----.----.---- @natiq-macbook-pro.local>
- # Message
- -------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement