Hallo, in einer Blazor Web App habe ich eine Class.cs Datei (diese sollte ein Email auslösen, Code ist per Azure ACS auch geprüft) jedoch wie starte ich diesen Code jetzt in einem Blazor Projekt ?
Wie geht das per default (oder z.B. per Butten Klick oder auch per Razor Page Ereigniss)?
Merci für den Support, marcel
Class.cs Code:
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Azure;
using Azure.Communication.Email;
using Azure.Identity;
namespace SendEmail
{
public class SendEmail
{
static async Task Main(string[] args)
{
// This code retrieves your connection string from an environment variable.
...
//Replace with your domain and modify the content, recipient details as required
var subject = "Welcome to Azure Communication Service Email APIs.";
var htmlContent = "<html><body><h1>Quick send email test</h1><br/><h4>This email message is sent from Azure Communication Service Email.</h4><p>This mail was sent using .NET SDK!!</p></body></html>";
var sender = "******@xyz.azurecomm.net";
var recipient = "******@xyz.com";
}
}
}