I am using django's core.mail package in conjunction with django-registration for a new user sign up workflow. I have an email account, "no-reply@(mycompany).com" through my company's google mail service, that i want to use to send these emails. In the google mail account settings i set the name for the email account as "(MyCompany) Support" so that if I mail directly from google mail, the emails come in from the account as being from "(MyCompany) Support ". However, when i use django's email settings to send mail, the emails show up in a client's email box as being from "no-reply" which is ugly and may be a bit off-putting to a new client. Is there a way to specify a "Name" for an email address when sending using django's built-in mailer so that the see the "Name" displayed when they get the email?
Here are my current settings in settings.py:
EMAIL_HOST='smtp.gmail.com'
EMAIL_PORT=587
EMAIL_HOST_USER='[email protected]'
EMAIL_HOST_PASSWORD='**********'
EMAIL_USE_TLS = True
Although Python provides a mail sending interface via the smtplib module, Django provides a couple of light wrappers over it. These wrappers are provided to make sending email extra quick, to help test email sending during development, and to provide support for platforms that can't use SMTP.
How to send multiple mass emails django. We need to create a Tuple of messages and send them using send mass mail. In this tutorial, we create a project which sends email using Django. We fill the data in the form and send it using Django Email.
Those solutions are useful if you're using django's email package directly. However, i didn't want to look for a hook to override the way that django-registration uses send_mail so I found the following setting when going through the django files, which lets you set a default from email.
DEFAULT_FROM_EMAIL='(My Company) Support <[email protected]>'
and it worked!
Figured someone else may find it useful, although i'm not so pretentious as to mark my own answer as correct.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With