hi mitja,
to look into the issue, i need to collect some information below:
1. which way you have set up smtp relay on your application to send email using office 365? you can find more details about the smtp relay in exchange online by referring to:
https://technet.microsoft.com/en-us/library/dn554323(v=exchg.150).aspx. please upload a screenshot about the settings on your application. to upload screenshots, select the
use rich formatting button in the forum, and then click insert /edit media like the picture shows below:

2. about the error “queued mail for delivery”, is it a bounce back email or any log file? provide the whole error message to us for analysis.
3. can all recipients not receive emails sent out from the application or some specific recipients?
4. can your office 365 account send emails to the recipients?
to protect your privacy, i have sent you a private message to collect the error message. you can click the url below to read and reply to it:
https://community.office365.com/en-us/user/conversations
regards,
larry