[Try it out](https://blazor-graph.azurewebsites.net/)
By participating Hack Together: Microsoft Graph and .NET hackathon as beginners, we downloaded the sample code from here
We created a new app registration Hackathon.Graph.Blazor under our coporate POC Azure subscription and configured the post-login-return-url as below:
We enriched the sample application by retrieving additional personal info and display first 10 email subjects via Microsoft Graph .
<table class="table table-striped table-condensed" style="font-family: monospace">
<tr>
<th>Property</th>
<th>Value</th>
</tr>
<tr>
<td>Name</td>
<td>@_user.DisplayName</td>
</tr>
<tr>
<td>Mail</td>
<td>@_user.Mail</td>
</tr>
<tr>
<td>MobilePhone</td>
<td>@_user.MobilePhone</td>
</tr>
<tr>
<td>OfficeLocation</td>
<td>@_user.OfficeLocation</td>
</tr>
<tr>
<td>JobTitle</td>
<td>@_user.JobTitle</td>
</tr>
</table>
<h4 class="text-primary">Top 25 Emails</h4>
<div class="table-responsive">
<table class="table table-hover table-borderless">
<thead>
<tr>
<td>From</td>
<td>Subject</td>
<td>Received at</td>
</tr>
</thead>
<tbody>
@foreach (var message in _messages)
{
<tr>
<td class="text-primary text-decoration-underline">@(message.From.EmailAddress.Address)</td>
<td>@message.Subject</td>
<td class="text-nowrap">@(message.ReceivedDateTime.Value.ToLocalTime().ToString())</td>
</tr>
}
</tbody>
</table>
</div>
var message = new Message
{
Subject = subject,
Body = new ItemBody
{
Content = body,
ContentType = BodyType.Text
},
ToRecipients = new Recipient[]
{
new Recipient
{
EmailAddress = new EmailAddress
{
Address = to
}
}
}
};
await _graphServiceClient.Me.SendMail(message).Request().PostAsync();