I am using gmail smtp in my django website. I have a contact form where user put email and message then I send a mail to the admin with :
email = EmailMessage('email subject', 'email message', settings.EMAIL_HOST_USER,
['[email protected]'],
headers = {'Reply-To': '[email protected]',
'Sender': '[email protected]','from': '[email protected]','Return-Path': '[email protected]'})
email.send(fail_silently=False)
email is sent/received correctly but when admin client select reply in gmail, it always reply to the settings.EMAIL_HOST_USER and not the user address. On the email original header the From and Return-path are set with the setting.EMAIL_HOST_USER