I just finished setting up a contact form thanks to some tutorial, but on the tutorial I took it says I have to setup sendgrid or some other service to get the reply. but thing is they aren't free. https://hellowebapp.com/news/tutorial-setting-up-a-contact-form-with-django/ Is there a way to get the emails for free?
def contact(request):
form_class = ContactForm
if request.method == 'POST':
form = form_class(data=request.POST)
if form.is_valid():
contact_name = request.POST.get('contact_name','')
contact_email = request.POST.get('contact_email','')
form_content = request.POST.get('content','')
template=get_template('contact_template.txt')
context = Context({
'contact_name':contact_name,
'contact_email':contact_email,
'form_content':form_content,
})
content = template.render(context)
email = EmailMessage(
"New Contact form submisssion",
content,
"your website"+'',
['ebagu.net@gmail.com'],
headers = {'Reply-To':contact_email})
email.send()
retu redirect('contact')
retu render(request, 'contact.html', {
'form':form_class,
})
I have this in txt file, and this is what I get in email
Contact Name:
Email:
Content:
