Your message wasn't delivered because the recipient's email provider rejected it.

Code Test 126 Reputation points
2022-02-23T05:52:54.223+00:00

I registered and created a new domain on Office 365 to experience O365 E3 trial version then created an application in Dot Net to send emails using graph API, both to same and different (gmail etc.) domains.
On coding side I don't see any error being produced, however on mail box side immediately I receive an email saying:

Delivery has failed to these recipients or groups:
******@something .onmicrosoft.com
Your message wasn't delivered because the recipient's email provider rejected it.

I am able to send emails from mailbox, manually by visiting https://outlook.office.com/
I am Office 365 global admin.

Outlook Management
Outlook Management
Outlook: A family of Microsoft email and calendar products.Management: The act or process of organizing, handling, directing or controlling something.
5,420 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Joyce Shen - MSFT 16,676 Reputation points
    2022-02-24T02:32:31.947+00:00

    Hi @Code Test

    Could you please share the complete NDR information you received, note to clear your personal information.

    For example, if you receive the code like Remote Server returned ‘550 5.7.520 Access denied, Your organization does not allow external forwarding.
    Then you will need to enable the forwarding.

    Go to the Office365 Security and Compliance Dashboard

    1. Expand Threat Management and click Policy
    2. Click Anti Spam
    3. In the Anti-Spam settings, locate Outbound policy and click Edit protection settings
    4. In the Outbound policy, expand Automatic forwarding rules. The default is set to Automatic – System-controlled.
    5. Select On – Forwarding is enabled and click Save. Forwarding to external mail addresses is now allowed. Note Microsoft says it may take up to 24 hours before the change takes effect.

    177319-image.png

    If that's not your case, please refer to this: How to set up a multifunction device or application to send email using Microsoft 365 or Office 365
    You could check which option you are using now, make sure you have meet all needs to use this option.


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    4 people found this answer helpful.

  2. Harie 21 Reputation points
    2022-03-04T01:17:47.93+00:00

    Check your SPF on your cpanel domain. Delete All spf record and make only one spf record like this :

    Name : yourdomain.com
    Time : 3600
    Type : TXT
    Record : v=spf1 include:spf.protection.outlook.com -all

    It's work for me!

    3 people found this answer helpful.

  3. Holly 0 Reputation points
    2023-12-12T11:30:55.4066667+00:00

    Add the email addresses to your 'safe' list. This sorted it for me.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.