Multiple outbound email addresses - how to actually set up?

Benjamin Nuttin
Giga Expert

I'm a bit confused about the "From" field on notifications. Per the documentation, it looks like I can just set it to any email address, but that seems off - surely I can't set up a notification to look like it came from mark@facebook.com - there must be some sort of validation. But the doc isn't clear on that.

Our email set up is via our company's SMTP server - service.portal@company.com

I want some emails to come from hr.team@company.com. Do I need to add this as another SMTP account (meaning I need my Exchange team to set up the account)? And then I set the "From" in my chosen notification to hr.team@company.com? But then how do I set service.portal@company.com as my default outbound account?

TIA.

1 ACCEPTED SOLUTION

Benjamin Nuttin
Giga Expert

Confirming what I thought - the account your instance is using to connect to your company's SMTP server must have rights to send emails as another account. It seems to on an email by email basis. So, if you connect to SMTP using mid.server.user, you'd need to set hr.team@company.com to allow mid.server.user to send emails on its behalf.

View solution in original post

5 REPLIES 5

Benjamin Nuttin
Giga Expert

To add to this - if I do try to set a different address in the "From", I get a "Client does not have permissions to send as this sender" error.

You will need to use email script to dynamically update from account email address for particular notifications.

 

(function runMailScript(current, template, event) {
email.setFrom("Name <" + current.recruiter_email.toString() + ">");
email.setReplyTo(current.recruiter_email.toString());
})(current, template, email, email_action, event);

So for example:

email.setFrom("JJG <jjg@gmail.com>");

So however you can get the "name" you would want to add that in to the same line.

 

 

REGARDS,

SACHIN

I tried that, but I get the same result... And more to the general point, this would mean we can effectively spoof any email as the sender of our SNow emails, which doesn't seem logical to me.

Benjamin Nuttin
Giga Expert

Confirming what I thought - the account your instance is using to connect to your company's SMTP server must have rights to send emails as another account. It seems to on an email by email basis. So, if you connect to SMTP using mid.server.user, you'd need to set hr.team@company.com to allow mid.server.user to send emails on its behalf.