الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

مساعده في smtp

بدأه ميولي برمجي في 24 نوفمبر 2013 · 6 رد · 503 مشاهدة · في ASP.NET
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

السلام عليكم ,ظهرت هذه المشكله بعد رفع الموقع عى استضافه 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 ومازالت نفس المشكله,مالحل؟

#3

شكرا لك لكن المشكله مازالت قائمه

#4

السلام عليكم

 

لقد جربت الكود التالي و شغال معاي 100%

 

   Dim Msg As New MailMessage()

        Dim fromMail As New MailAddress("mail1@gmail.com")

 

        Msg.From = fromMail

 

        Msg.[To].Add(New MailAddress("mail2@gmail.com"))

 

 

        Msg.Body += "بسم الله الرحمن الرحيم"

        'Msg.Body += txtsubject.Text

        'Msg.Body += txtphone.Text

        'Msg.Body += txtemail.Text

        'Msg.Body += txtcomment.Text

        Msg.IsBodyHtml = True

        Dim sSmtpServer As String = ""

        Dim a As New SmtpClient("smtp.gmail.com", 587)

 

        a.EnableSsl = True

        a.DeliveryMethod = SmtpDeliveryMethod.Network

        'a.UseDefaultCredentials = true;

        a.UseDefaultCredentials = False

        a.Credentials = New System.Net.NetworkCredential("mail@gmail.com", "mypassword")

        a.Send(Msg)

#5

نعم  يشتغل على localhost تمام لكن بعد الرفع على الاستضافه تظهر هذه المشكله مالحل؟

#7

شكرا لك

مواضيع مشابهة