Not able to send a mail using Graph Explorer

%3CLINGO-SUB%20id%3D%22lingo-sub-2988243%22%20slang%3D%22en-US%22%3ENot%20able%20to%20send%20a%20mail%20using%20Graph%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2988243%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20tried%20to%20send%20a%20mail%20through%20Graph%20API%20but%20receiving%20an%20error%20that%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3ERemote%20Server%20returned%20'550%205.7.708%20Service%20unavailable.%20Access%20denied%2C%20traffic%20not%20accepted%20from%20this%20IP.%20For%20more%20information%20please%20go%20to%20%3CA%20href%3D%22http%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D526653%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttp%3A%2F%2Fgo.microsoft.com%2Ffwlink%2F%3FLinkId%3D526653%3C%2FA%3E%20AS(7230)%20%5BPNYPR01MB5114.INDPRD01.PROD.OUTLOOK.COM%5D'%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EBelow%20is%20the%20code%3A%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3E%3CDIV%3E%3CSPAN%3Epublic%3C%2FSPAN%3E%20%3CSPAN%3EsendMail%3C%2FSPAN%3E%3CSPAN%3E()%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CBR%20%2F%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Econst%3C%2FSPAN%3E%20%3CSPAN%3Email%3C%2FSPAN%3E%3CSPAN%3E%20%3D%20%7B%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3Esubject%3C%2FSPAN%3E%3CSPAN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%3C%2FSPAN%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2988641%22%20slang%3D%22en-US%22%3ERe%3A%20Not%20able%20to%20send%20a%20mail%20using%20Graph%20Explorer%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2988641%22%20slang%3D%22en-US%22%3ESeems%20like%20you're%20triggering%20some%20of%20the%20built-in%20protections%2C%20can%20you%20send%20OK%20via%20Outlook%2FOWA%3F%20If%20you%20continue%20running%20into%20this%2C%20best%20open%20a%20support%20case%20and%20work%20with%20the%20agent%20to%20get%20an%20exception%20configured.%3CBR%20%2F%3EHere's%20the%20generic%20error%20description%3A%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fmail-flow-best-practices%2Fnon-delivery-reports-in-exchange-online%2Ffix-error-code-5-7-700-through-5-7-750%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fexchange%2Fmail-flow-best-practices%2Fnon-delivery-reports-in-exchange-online%2Ffix-error-code-5-7-700-through-5-7-750%3C%2FA%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I have tried to send a mail through Graph API but receiving an error that 

Remote Server returned '550 5.7.708 Service unavailable. Access denied, traffic not accepted from this IP. For more information please go to http://go.microsoft.com/fwlink/?LinkId=526653 AS(7230) [PNYPR01MB5114.INDPRD01.PROD.OUTLOOK.COM]'

 

Below is the code:

 

public sendMail(){

  const mail = {
    subject: "This is a sample",
    toRecipients: [{
        emailAddress: {
            address: "xxxxxx.com"
        }
    }],
    body: {
        content: "This is a sample",
        contentType: "html"
    }
};
   
this.props.context.msGraphClientFactory.getClient().then((client: MSGraphClient:( void => {
    client
    .api('/me/sendMail')
    .post({message: mail}, (err, res) => {
        alert("Email Sent");
    });
   
  });
1 Reply
Seems like you're triggering some of the built-in protections, can you send OK via Outlook/OWA? If you continue running into this, best open a support case and work with the agent to get an exception configured.
Here's the generic error description: https://docs.microsoft.com/en-us/exchange/mail-flow-best-practices/non-delivery-reports-in-exchange-...