Hi,
Help needed!
smtp.gmail.com return an empty string after the mail is sent and my app stop showing a blank page:
you can try https://parogsingler.dk/Home/Kontakt
Stopping at https://parogsingler.dk/Home/SendEmailAsync
My code:
using (var client = new SmtpClient())
{
var credentials = new NetworkCredential
{
UserName = "admin@parogsingler.dk", // replace with valid value
Password = "xxxxxx" // replace with valid value
};
client.LocalDomain = "parogsingler.dk";
// check your smtp server setting and amend accordingly:
client.Connect("smtp.gmail.com", 587, SecureSocketOptions.Auto);
client.AuthenticationMechanisms.Remove("XOAUTH2");
await client.AuthenticateAsync(credentials);
await client.SendAsync(emailMessage).ConfigureAwait(false);
await client.DisconnectAsync(true).ConfigureAwait(false);
RedirectToAction("Thanks");
}
Any clues about this?
Regards,
Poul Erik