4

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 = 'support@site.com'
SERVER_EMAIL = 'support@site.com'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 2525
EMAIL_USE_TLS = False
EMAIL_HOST_USER = 'user@gmail.com'
EMAIL_HOST_PASSWORD = 'password'

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

Albert
  • 133
  • 2
  • 10
  • 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](https://sendgrid.com/docs/User_Guide/Settings/Whitelabel/domains.html) e.g. `support@email.site.com`. – Alasdair Jan 22 '18 at 10:27
  • 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? – Artisan Jan 22 '18 at 13:01
  • 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 support@site.com). – Albert Jan 22 '18 at 13:09

1 Answers1

11

Try

DEFAULT_FROM_EMAIL = "Site Support <support@site.com>"
Artisan
  • 1,974
  • 1
  • 18
  • 23