How can I change email sender's name in django
Asked Answered
K

1

5

I'm creating email system in my django project and faced to next question: Send email from custom email sender name, f.e. sending email from gmail(btw it works in my project) requires sending messages only from gmail account, same thing with smtp-pulse, sendgrid and etc. . My question is: May I use any of already configured smtp servers in my case, or I only need to create my own using smtplib(f.e) and configure it? Tried:

DEFAULT_FROM_EMAIL = '[email protected]'
SERVER_EMAIL = '[email protected]'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 2525
EMAIL_USE_TLS = False
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'password'

This one doesn't work. Same with mail.ru/smtp-pulse.com

Kochi answered 22/1, 2018 at 8:48 Comment(3)
This isn't a good question for Stack Overflow because recommending email providers is off-topic. Every providers has it's own policy about which domains it will send from. For example, sendgrid will allow you to whitelist subdomains e.g. [email protected].Syverson
I understood from the question that you want to send an email, and that a name appear as the sender and not just an email, is this correct? If so you can just reformat the DEFAULT_FROM_EMAIL as in the answer I added, otherwise what "name" are you referring to?Upland
I wanted user to see that email has been sent from my custom name, or ,if it's possible, send email message exactly from this email account(e.g. using gmail smtp send email from [email protected]).Kochi
U
13

Try

DEFAULT_FROM_EMAIL = "Site Support <[email protected]>"
Upland answered 22/1, 2018 at 9:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.