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

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -