This must be set from the web.config (Can't be done from the portal)(Usual location (c:\Inetpub\wwwroot\Production Portal)
<network host="smtp.office365.com" port="587" userName="firstname.lastname@example.org" password="password" enableSsl="true" />
The user used in this must be added to have send as permission for EVERY portal user (otherwise relaying won't work)
If you go to portal.office.com -->Admin Centers --> Exchange --> Protection --> DKIM
You should see something like this: yourdomain.mail.onmicrosoft.com, this should also work WITHOUT having to use the send as permission.