> 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", "anot...@email.com", ["d...@gmail.com"]) > return render_to_response('hello.html', locals()) > > # settings.py > EMAIL_USE_TLS = True > EMAIL_HOST = "smtp.gmail.com" > EMAIL_HOST_USER = "myem...@gmail.com" > EMAIL_HOST_PASSWORD = "mypassword" > EMAIL_PORT = 587 > DEFAULT_FROM_EMAIL = "notexi...@email.com" > > The email is correctly send to d...@gmail.com but there is no mention of > anot...@email.com. The email is received as coming from > myem...@gmail.com. I was expecting that it would be anot...@email.com > (or at least a mention of it). >
My guess is that your SMTP provider (gmail) will only allow the From: header to be set to the owner of the account (myem...@gmail.com) as a spam prevention measure. I don't think this is a Django issue per se. Cheers, Dan -- Dan Fairs | dan.fa...@gmail.com | www.fezconsulting.com -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.