email - smtp connection with c# not working -


In my project I need to send mail to the customer. I am trying to do this with achieving the errors of SMTP. Please help me

Enter the code here

  MailMessage Mail = New MailMessage (); Mail.Subject = "Topic"; similarity. Body = "sample mail"; Mail.From = New System.Net.Mail.MailAddress ("mymailID@gmail.com"); Mail.IsBodyHtml = Incorrect; Mail.BodyEncoding = System.Text.Encoding.Unicode; Mail.SubjectEncoding = System.Text.Encoding.Unicode; Mail.To.Add ("myFriendmailID@gmail.com"); Network credential cred = new network credentials ("mymailid@gmail.com", "mypassword"); SmtpClient smtp = new SmtpClient ("smtp.gmail.com"); Smtp.UseDefaultCredentials = false; Smtp.EnableSsl = true; Smtp.Credentials = cred; Smtp.Port = 587; Smtp.Send (mail);  

error message "No connection can be made because the target machine has actively rejected it 74.125.130.109:" 87 "

< / Html>

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -