I have posted the contact form on my website, and I have it in my settings.
# Email settings EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.gmail.com' EMAIL_HOST_USER = ' myemail@gmail.com ' EMAIL_HOST_PASSWORD = '****' EMAIL_PORT = 587
And this is in my views.py
name = form.cleaned_data['name'] email = form.cleaned_data['email'] message = form.cleaned_data['message'] subject = 'Email from ' + name content = name + '\r\n' + email + '\r\n\r\n' + message send_mail(subject, content, email, [' me@myemail.com '])
Everything works correctly, I receive an email with all the information, but the email comes from myemail@gmail.com , although the from_email parameter has an email var with an email sender.
Does this not work, or am I doing something wrong?
I wanted to receive an email from the sender, so that y can simply reply to it, as in PHP.
Thanks.
source share