Set Email Name for SMTP

(Manthan Mallikarjun) #1


Some forums systems allow you to put a “name” when sending an email.

When Discourse sends an email, the “from” shows It would be great if we could pass a name so it would be Doamin Notification as the name.

(Jeff Atwood) #2

It already does this, see examples posted here in the past…

From: How-To Geek Discussion digest <>

from: SmashMartian <>

Reply-To: Norton Imperial Labs : Discussion digest <>

(Michael Downey) #3

What do you have set for the site setting “notification email”? This is what should be appearing on notifications from Discourse.

(Manthan Mallikarjun) #4

Sorry. I double checked. The name says “contact”. The email is set to "". How can I make it so that the name says “Forum Notification” or something like that?

(Michael Downey) #5

From what I have seen and recall, most notifications will take the form:

 From: "username" <>

Where username is the short username (e.g. nahtnam) of the person who generated the content that created the notification, and where is what you specified in the notification_email site setting.

Is this what you’re seeing? If so, things are working as intended.

Personally, I can’t stand this because it breaks e-mail standard conventions of having someone’s actual name in that field, as you say. But it’s pretty clear the designers disagree with me. :slight_smile:

(Manthan Mallikarjun) #6

Yep, but for things like reset password and confirmation emails the name just shows up as “contact” (if the email is set to Is there a way to change that?

(Michael Downey) #7

Right. Most email clients will default to just the part before the if there’s not a name specified like "My Discourse Site" <>.

I agree, it’d be a lot nicer if the system allowed the From: field to use the Site Name here for non-notification emails.

(Jeff Atwood) #8

@neil can you double check here and make sure we’re using the email_site_title setting as appropriate on reset password and confirmation emails?

(Neil Lalonde) #9

It wasn’t, but I just changed it so it does. So @nahtnam, get the latest code and you’ll be able to set email_site_title to change that behaviour.

(Jeff Atwood) #10

And even if you don’t use email_site_title it should respect the regular site name, yes? The email_site_title is the special “I have a crazy site name so I need another name that’s shorter and not crazy to use in emails” name.

(Manthan Mallikarjun) #11

It doesnt use the site name. My site name is not set to “contact”

(TheLoneCuber) #12

Is there any way to remove the surrounding brackets from [email_prefix] so it’s just email_prefix?


Is there a way to do this - remove the brackets from the email subject? Thanks