Click here to Skip to main content
15,914,327 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have application which is sending mail through smtp using Rediffmail it was working fine but now it is showing 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)

i have checked the smtp for this server
below is my code
please suggest some solution its urgent thanks in advance

What I have tried:

try
          {
              System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();

              MailMessage mail = new MailMessage();

              mail.To.Add(To);
              mail.From = new MailAddress("emailid");
              mail.Subject = subject;
              mail.Body = body;
              mail.IsBodyHtml = true;
              SmtpClient smtp = new SmtpClient("smtp.rediffmailpro.com", 25);
              smtp.EnableSsl = true;

              smtp.UseDefaultCredentials = false;
              smtp.Credentials = new System.Net.NetworkCredential("username", "password");
              smtp.Send(mail);

              return (1);


          }
          catch (Exception ex)
          {
              TraceService(ex.Message);
              return (0);
          }
Posted
Updated 1-Aug-17 3:02am
Comments
ZurdoDev 1-Aug-17 8:42am    
It doesn't sound like a code issue.

1 solution

Despite you passing your your username and password, the server wants you to "get messages first to authenticate yourself". What this means, is that the server wants you to retrieve your messages using POP3 and then it will let you send the mail. To do this, connect to pop.rediffmailpro.com with port 110 and pass these messages:
USER <username>
PASS <password>
LIST
QUIT

I don't know why the server wants this even when you pass your username and password, but that's what it appears to tell.
 
Share this answer
 
Comments
Ben J. Boyle 1-Aug-17 12:21pm    
Yep, I've used several email services in the past that required a POP get to authenticate before it would allow an SMTP send. Never really questioned it, just checked the box in the options to do it that way when required.
Member 12966735 1-Aug-17 23:49pm    
im new to this so can you please guide me the steps to do this i mean whether i have to do this with command line or in web browser to enter this address pop.rediffmailpro.com?
Thomas Daniels 2-Aug-17 0:58am    
Do a Google search.

While you can do this with telnet manually, you'll have to do it programatically if you want to automate the process every time before you send an email.
Member 12966735 2-Aug-17 2:46am    
manually its working but not getting through code didnt find code on google for this now im trying to execute command prompt through code but dont knw how to pass the multiple arguments
Thomas Daniels 2-Aug-17 2:58am    
Executing the command prompt isn't what you need to do here. You need to implement telnet-like functionality. Here is a blog that describes it for .NET 2.0 but I believe you can still use it.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


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