32 lines
741 B
Plaintext
32 lines
741 B
Plaintext
@page "/counter"
|
|
@using GWMS.Data
|
|
@using Microsoft.AspNetCore.Identity.UI.Services
|
|
|
|
@inject IEmailSender EmailSender
|
|
|
|
<h1>Counter</h1>
|
|
|
|
<p>Current count: @currentCount</p>
|
|
|
|
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
|
|
|
<br />
|
|
<button class="btn btn-danger" @onclick="SendTestEmail">Test Invio Email</button>
|
|
|
|
@code {
|
|
private int currentCount = 0;
|
|
|
|
private void IncrementCount()
|
|
{
|
|
currentCount++;
|
|
}
|
|
|
|
private async void SendTestEmail()
|
|
{
|
|
var toAddress = "samuele@steamware.net";
|
|
var subject = "Prova invio da MailKit";
|
|
var body = "Invio tramite servizio integrato dotNetCore";
|
|
await EmailSender.SendEmailAsync(toAddress, subject, body);
|
|
}
|
|
|
|
} |