السلام عليكم ,ظهرت هذه المشكله بعد رفع الموقع عى استضافه arvixe
The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Requiredولم تكن تظهر في ال localhost وهاذا الكود
MailMessage Msg = new MailMessage();
MailAddress fromMail = new MailAddress("email@gmail.com");
Msg.From = fromMail;
Msg.To.Add(new MailAddress("email@gmail.com"));
Msg.Body += txtName.Text;
Msg.Body += txtsubject.Text;
Msg.Body += txtphone.Text;
Msg.Body += txtemail.Text;
Msg.Body += txtcomment.Text;
Msg.IsBodyHtml = true;
string sSmtpServer = "";
sSmtpServer = "smtp.gmail.com";
SmtpClient a = new SmtpClient();
a.EnableSsl = true;
a.DeliveryMethod = SmtpDeliveryMethod.Network;
//a.UseDefaultCredentials = true;
a.UseDefaultCredentials = false;
a.Credentials = new System.Net.NetworkCredential("email@gmail.com", "mypassword");
a.Port = 587;
a.Send(Msg);مع العلم اني جرت ووضعت a.UseDefaultCredentials مره بfalse ومره ب true ومازالت نفس المشكله,مالحل؟