Send As From a different email domain in Office 365 Exchange Online

I get this requested quite often so I thought I should post how to do it.

The scenario is that you have your main email account with Microsoft on Office 365/Exchange Online, say Fred@Bloggs.com, and we connect to that mailbox via Outlook and/or Outlook Web Access. We also have email accounts setup elsewhere – on Google’s Gmail for instance say Fred@Jacks.com – and you are forwarding those emails to your main Office 365 account so that you know when new mail arrives.

Usually you would have to logon to the other service to reply to the Fred@Jacks.com emails – wouldn’t it be nice if you could reply from your Fred@bloggs.com account instead? Well, you can, and it’s really easy to setup:

Firstly, I can’t verify if this works with all email providers – it does work with Gmail accounts though.

To begin with you need to setup a contact in Office 365 for the other email address – Fred@Jacks.com:

Logon as the admin user to Office 365/Exchange Online.

Goto to the Admin Centres, choose Users, select Contacts and add the email:

You will also need to add the domain to the verified domains list:

Goto Admin center, Settings, Domains.

Follow the instructions on adding a domain – you do not need to add the email DNS records in order for the domain to be used in your account. You just need to verify you own the account by adding the TXT DNS record and verifying via this portal.

Note: the adding of a domain can take up to 4 hours to complete – took only an hour in my case.

Next you need to connect to the Exchange online server using Powershell:

This article explains how to do that: https://technet.microsoft.com/en-us/library/jj984289%28v=exchg.150%29.aspx

Open Powershell

Make sure you have issued the command to allow scripts to run:

Set-ExecutionPolicy RemoteSigned

Select ‘Y when prompted to turn scripting on.

Type in the credentials command:

$UserCredential = Get-Credential

You will be prompted for a username and password – enter you admin username and password for Office 365/Exchange Online.

Type in the session variable creation command:

$Session = New-PSSession -ConfigurationName
Microsoft.Exchange
-ConnectionUri https://outlook.office365.com/powershell-liveid/
-Credential $UserCredential -Authentication Basic -AllowRedirection

And then issue the session import command:

Import-PSSession $Session

Here’s a screen shot after issuing all 3 commands:

9.png

You will then see a bunch of stuff being downloaded and will eventually return to the command prompt.

You are now connected and can start issuing commands. For a list of commands available this is a good article:

http://o365info.com/mailbox-permissions-powershell-commands/

You can use a command like:

Get-MailboxPermission Fred

To test connectivity – this will list the permissions for user Fred (Fred@Bloggs.com).

The command:

Get-RecipientPermission "Fred Bloggs"

Will list the permissions on the contact we created above – there shouldn’t be any at this stage.

To give Send As permission to the contact issue this command:

Add-RecipientPermission "Fred Bloggs" -AccessRights SendAs -Trustee "Fred"

This gives the user Fred (Fred@Bloggs.com) permission to Send As the contact “Fred Bloggs” (Fred@Jacks.com).

You may receive an error at this point along these lines:

You can't use the domain  because it's not an accepted domain for your organization.

This means the domain verification and adding process has not completed yet – can take up to 4 hours for this to complete. If you continue to get this error after 4 hours then something must have gpne wrong with the domain adding process.

If all is ok you should be prompted for confirmation – select ‘Y’ to add the permission.

That’s it!

You should close the session properly – otherwise it will stay open – by issuing:

Remove-PSSession $Session

You can now close Powershell.

In Outlook or Outlook Web Access create a new email, make sure you can see the From: option (In Outlook if it’s not there go to the Options menu and click the From button), type in the email address you want to Send As – Fred@Jacks.com – you only need to do this once, outlook will remember it from then on and you can select it from the pull down list (however, at time of writing it was not saving it in outlook web access). Compose your message and send – if you have forwarding setup as described above you should then receive the message and note that the from address is indeed as expected: Fred@Jacks.com.

When you reply to messages received you will need to choose the from address from the pulldown – it defaults to the main mailbox from address – Fred@Bloggs.com – there is no way of changing this behaviour that I know of.

Advertisements

Author: James

IT Manager - Network, Web coding, MS SQL and Online Mapping expert

5 thoughts on “Send As From a different email domain in Office 365 Exchange Online”

  1. Hi James,

    Great solution, thanks a lot for sharing it. We use it for 6 months now and it works like a charm.

    Unfortunately it seems Exchange blocked the method for newly added accounts. When I add the recipientpremission in powershell we receive an error: You can’t use the domain because it’s not an accepted domain for your organization.

    Hopefully they won’t block service for excisting configurations.

    Best regards

    Theo van Laar

    Like

  2. I can confirm this functionality has changed – existing setups are still ok as Theo has found. I am looking into it and will get back shortly.

    Like

  3. OK, problem solved – you now have to add the domain name you wish to send as to the verified domains list under Admin, Settings, Domains. You don’t have to add all the email DNS records to your domain’s DNS server, just add the TXT record to verify the domain. Once it is listed in the domains list and fully added (can take 4 hours) then you are able to add the recipient permissions. I have updated the post to reflect this.

    Note: if you had already added receipient permissions for domains before MS changed over requiring the need to verify domains then they still work without needing to be listed in the verified domains list. But it’s probably a good idea to get those domains verified as well just in case MS change something in future.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s