Hi, use this code. This is working version from my project.
string smtpAddress = "smtp.gmail.com";
int portNumber = 25;
string emailFrom = "shelbypurcell000@gmail.com";
string password = "";
string emailTo = "shelby.p67@gmail.com";
string subject = userMessageSubject;
string body = userMessageBody;
MailMessage objMailMessage = new MailMessage(emailFrom, emailTo, subject, body);
SmtpClient objSmtpClient = new SmtpClient(smtpAddress);
objSmtpClient.Port = portNumber;
objSmtpClient.UseDefaultCredentials = false;
objSmtpClient.Credentials = new NetworkCredential(emailFrom, password);
objSmtpClient.EnableSsl = true;
objMailMessage.Attachments.Add(new Attachment(Employee.FileLocation));
objSmtpClient.Send(objMailMessage);