Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Asp.net core 1.1.0 and Mailkit

$
0
0

Hi,

I'm using mailkit to send mail forms from my web site.

But I have problems with authentication - getting response from gmail server error 500.

 using (var client = new SmtpClient())
            {
                var credentials = new NetworkCredential
                {
                    UserName = "admin@parogsingler.dk", // replace with valid value
                    Password = "popopopo" // 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 ("sent");
            }

Hope someone can give me a clue how to fix that...

Regards,

Poul Erik


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>