Java Microsoft Graph SDK send email rejected by own account as spam

Len 21 Reputation points
2022-11-28T15:29:03.777+00:00

I tried sending emails from MS Graph Java app, as in this tutorial . Most of the emails have been rejected as spam, sending to the same dev account it's sending from, and to my work email. It works fine to my personal email as I've turned off spam protection. This is bizarre as its rejecting emails sent from itself.

len@xxxxxx.onmicrosoft.com  
Remote Server returned '550 5.7.501 Service unavailable. Spam abuse detected from IP range. For more information please go to http://go.microsoft.com/fwlink/?LinkId=526653. S(2017052602) [AM8PR04MB8002.eurprd04.prod.outlook.com]'  

I assume there's some sort of email signing issue, to do with whitelabelling? I am new to Graph API. I cannot find anything online about whitelabelling an Outlook account. The emails are sending from my tenant account.

I'm building an email automation system for work, which is useless if my work email rejects the emails as spam.

How do I get the emails to send without being rejected as spam? Thanks for your time.

EDIT: My email is now totally blocked and won't send out at all, even from the GUI. It appears it thinks my account has been compromised. It does beg the question how one is supposed to create an automated mail send API when you get blocked for sending the mails. How do I unblock it? Here says only things about connectors between work mail servers and my account. It doesn't apply as this is only a testing tenant. Google is not helping.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,507 questions
0 comments No comments
{count} votes

Accepted answer
  1. RajeshKumarMSFT 1,971 Reputation points Microsoft Vendor
    2022-11-28T16:12:37.403+00:00

    Hi @Len ,

    Hope you are doing well,

    Generally these issues occur while using trail tenant to perform this send email activity using Graph API.

    This error occurs when sending email from known, low reputation IP addresses that are typically used by new customers on Trail tenants. To fix this issue your Tenant needs to be added to a sending exclusion for 60 days to allow them to use blocked IPs whilst they still have a new/trial license.

    Please raise a case with MS Support team from your tenant where you are facing issue, respective team will provide exclusion for your tenant.
    You can raise support ticket from aad.portal.azure.com

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    Hope this helps.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful