How do you send a link as clickable text in the body of an email using graph api?

Trevor Westin 26 Reputation points
2022-06-13T19:11:41.31+00:00

I'm using react.js and have gotten to the point where I can send mail with plain text. I want to include clickable text which links to a site. Below is what I have set up for the body so far where myMessage is simply just a string.

sendMail = {  
      message: {  
        subject: subject,  
        body: { contentType: 'Text', content: myMessage},  
        toRecipients: [  
          {  
            emailAddress: { address: recipient },  
          },  
        ],  
        ccRecipients: [  
          {  
            emailAddress: { address: cc },  
          },  
        ],  
      },  
    }  
  
graphMailer.post('/me/sendMail', sendMail).then((response) => {  
      console.log(response)  
    })  
  
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,685 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Trevor Westin 26 Reputation points
    2022-06-13T19:50:45.933+00:00

    GOT IT!! All you have to do is change...

    contentType: 'html'   
    
    1 person found this answer helpful.
    0 comments No comments