public async Task SendEmailAsync(string email, string subject, string message)
{
var emailMessage = new MimeMessage();
emailMessage.From.Add(new MailboxAddress("mail from site", "mail@gmail.com"));
emailMessage.To.Add(new MailboxAddress("", email));
emailMessage.Subject = subject;
emailMessage.Body = new TextPart(MimeKit.Text.TextFormat.Html)
{
Text = message
};
using (var client = new SmtpClient())
{
await client.ConnectAsync("smtp.gmail.com", 465, true);
await client.AuthenticateAsync("mail@gmail.com", "password");
await client.SendAsync(emailMessage);
await client.DisconnectAsync(true);
}
}
я шрифт уже 40 сделал, без изменений. vs code перезапускал, если что