Microsoft has a few options depending on how you want to use Office 365 to relay your email.
- Authenticate a device/application and send email using an Office 365 mailbox
- Send mail directly from an application/printer
- Office 365 SMTP relay service
Use this KB from Microsoft to configure an SMTP relay in Office 365.
Office 365 MVP