Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting an error "Mailbox name not allowed. The server response was: sorry, Authentication failed or timed out. Please do get messages first to authenticate yourself.(#4.4.3)" while sending Message. I am using Rediffmailpro so according to that i had changed the port address . but when i am setting gmail settings its working fine . please help to solve the problem .

C#
string from = "noreply@mail.org";
       string to = "mail1@name.org";
       string Password = "password$";
       int port = Convert.ToInt32(ConfigurationManager.AppSettings["port"]);
       string smtp = Convert.ToString(ConfigurationManager.AppSettings["smtp"]);
       string Subject = "Enquiry";
       string body = "Sender Name :" + txtname.Text + "\n" +
                    "Phone :" + txtphone.Text + "\n" +
                    "Email :" + txtemail.Text + "\n" +
                    "Address :" + txtaddress.Text + "\n"
                    + "Enquiry :" + txtenquiry.Text;
       MailMessage Msg = new MailMessage(from, to, Subject, body);
       //Smtp Host is the  name or Ip host of the computer used for sending mail
       SmtpClient smtpobj = new SmtpClient("smtp.rediffmailpro.com", 25);
       smtpobj.Host = "smtp.rediffmailpro.com";
       smtpobj.Port = 25;
       smtpobj.EnableSsl =false;
       smtpobj.UseDefaultCredentials = true;
       smtpobj.Credentials = new System.Net.NetworkCredential(from, Password);

       try
       {
           smtpobj.Send(Msg);
           ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "Hi", "<script type='text/javascript'>alert('Your Message Has Been Send ');</script>", false);
           CleaContents();
       }
       catch (Exception ex)
       {
           lbltext.Text = ex.Message;
       }
Posted
Updated 17-Feb-14 21:54pm
v2
Comments
ZurdoDev 18-Feb-14 7:09am    
The error is clear. Where are you stuck?
ManojMurali 19-Feb-14 0:50am    
smtpobj.Send(Msg);
ZurdoDev 19-Feb-14 7:55am    
No. That is not where you are stuck. Do you understand what the error is telling you?
agent_kruger 27-Jun-14 0:42am    
sir, the error shown in the heading appears at the "smtpobj.Send(Msg);" statement. I am also experiencing the same situation as the owner of the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900