0

I want to send an email to users with different from field values using smtp gmail server from the django app. I am able to send the mail successfully to users but the from field does not take the value that I provide in send_mail() but instead takes the EMAIL_HOST_USER value defined in settings.py

From field value should take any domain email address i.e.

  a mail from: xyz@yahoo.co.in or .com 
     or  from: abc@hotmail.com 
     or  so on 

How can I achieve this behavior? Please help. I am new to using django and email functionality.

shubhanjalee
  • 47
  • 1
  • 8

1 Answers1

2

You cannot forge an email using Google's SMTP server. They will keep on using the current user's information (the login credentials you supplied). If you want to "change"/forge the email header, use your own email server/SMTP

Vhortex
  • 381
  • 1
  • 7
  • if I don't want to use any smtp server, can I achieve the functionality that I want in django by some other way? – shubhanjalee Jun 09 '15 at 09:44
  • 1
    I am not fully sure but most of the time, pyhton usually runs over a linux environment which have a built-in mail sending feature. (depends on how the OS was installed) – Vhortex Jun 10 '15 at 01:01