I'd like to send an email from django. This is the code I'm using :
# views.py
def hello(request):
send_mail('subject', "body", "ano...@email.com", ["de...@gmail.com"])
return render_to_response('hello.html', locals())
# settings.py
EMAIL_USE_TLS = True
EMAIL_HOST = "smtp.gmail.com"
EMAIL_HOST_USER = "mye...@gmail.com"
EMAIL_HOST_PASSWORD = "mypassword"
EMAIL_PORT = 587
DEFAULT_FROM_EMAIL = "note...@email.com"
The email is correctly send to de...@gmail.com but there is no mention of
ano...@email.com. The email is received as coming from
mye...@gmail.com. I was expecting that it would be ano...@email.com
(or at least a mention of it).
Thank you
mart
My guess is that your SMTP provider (gmail) will only allow the From: header to be set to the owner of the account (mye...@gmail.com) as a spam prevention measure. I don't think this is a Django issue per se.
Cheers,
Dan
--
Dan Fairs | dan....@gmail.com | www.fezconsulting.com