How can one set a hyperlink using EmailMessage with Outlook being the default mail client

Paul Ryan 331 Reputation points
2024-01-09T21:47:43.6966667+00:00

VS 2022 17.8.4

c# ver 10

Outolok Ver You have Microsoft Outlook Version 1.2024.103.100 (Production). Client Version is 20231215008.09

I am trying to set a hyperlink using EmailMessage with Outlook being the default mail client

private async Task ComposeEmail()
{
    string body = "DownLoad Reports : <a href=" + ReportsDownloadLink + ">click here</a>";

    EmailMessage emailMessage        = new EmailMessage();
    emailMessage.Body       = body;
    emailMessage.Subject    = "Reports for " + SFiles.PtRptList.PtName;
    await EmailManager.ShowComposeNewEmailAsync(emailMessage);
}


I want to have a hyperlink 
Download Reports : <a href=https://muatestone.blob.core.windows.net/wizsot/zip%5CPeter Paulzo Report%28s%29.zip?sv=2023-11-03&st=2024-01-09T21%3A23%3A26Z&se=2024-01-11T09%3A23%3A26Z&sr=b&sp=r&sig=Plp5plCUYWwy1YqGmmekKR3woktF1LB7nFRbEw44%2FD8%3D>click here</a>


This is what I am looking to achieve

Download Reports:  [Click here](https://muatestone.blob.core.windows.net/wizsot/zip%5CPeter%20Paulzo%20Report%28s%29.zip?sv=2023-11-03&st=2024-01-09T21%3A23%3A26Z&se=2024-01-11T09%3A23%3A26Z&sr=b&sp=r&sig=Plp5plCUYWwy1YqGmmekKR3woktF1LB7nFRbEw44%2FD8%3D"https://muatestone.blob.core.windows.net/wizsot/zip%5CPeter Paulzo Report%28s%29.zip?sv=2023-11-03&st=2024-01-09T21%3A23%3A26Z&se=2024-01-11T09%3A23%3A26Z&sr=b&sp=r&sig=Plp5plCUYWwy1YqGmmekKR3woktF1LB7nFRbEw44%2FD8%3D")

I understand that EmailMessage.Body only does plain text. I am looking to see if there is a work around

thanks

Paul

Microsoft 365 and Office | Development | Other
Developer technologies | .NET | Other
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 81,976 Reputation points Volunteer Moderator
    2024-01-09T23:47:00.4333333+00:00

    just set

    emailMessage.IsBodyHtml = true;

    and make the body valid html


Your answer

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