LoginPage

Login page

Simple Login Page

Username Password

Senin, 15 Oktober 2018

Send email smtpClient using Gmail Account

I just got the knowledge how to send an email using gmail account by smtpclient.
The sample is using C#.

SmtpClient client = new SmtpClient();                    
client.Host = "smtp.gmail.com";
client.Port = 587;
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCredential(stFromUserName, stFromPassword); 
client.EnableSsl = true;
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.Send(mail);


You'll also need to go here and enable less secure apps.
Or if you have two step authentication on your account you'll need to set an app specific password, then use that password in your code instead of your main account password.
Thanks to equalsk
Reference : 

Tidak ada komentar: