| Author |  | 
      
        | Anand Newbie
 
  
 
 Joined: 22 January 2008
 Location: New Zealand
 Online Status: Offline
 Posts: 2
 | 
          We get following message when our application tries to send an email...
           | Posted: 22 January 2008 at 4:34pm | IP Logged |   |  
           | 
 |  ==============================================
 01/21/2008 15:01:15 Type : MailBee.SmtpMail.MailBeeSmtpLoginBadCredentialsException, MailBee.NET, Version=3.0.2.74, Culture=neutral, PublicKeyToken=cd85b70fb26f9fc1 Message : The server has rejected authentication data sent by the client.
 The server responded: 535 5.7.3 Authentication unsuccessful..
 Source : MailBee.NET Help link : AccountName : Password : ResponseCode : 535 IsTransientError : False ResponseString : 535 5.7.3 Authentication unsuccessful. ResponseEncoding : System.Text.SBCSCodePageEncoding RemoteEndPoint : 10.104.8.70:25 RemoteHostName : mailgate.nzpost.co.nz Protocol : Smtp ErrorCode : 116
 ==============================================
 
 Can anyone help with a solution?
 
 Regards,
 Anand
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          Are you sure the application tries to authenticate with correct username and password? In most cases "535 5.7.3 Authentication unsuccessful" response means incorrect credentials.
           | Posted: 23 January 2008 at 12:12am | IP Logged |   |  
           | 
 |  
 Please try to vary username as follows:
 
 - username (just username)
 - username@domain.com (full e-mail)
 - domain.com\username (domain\user)
 
 Please also try to send a message from the same account on the same SMTP server using another e-mail client like MS Outlook (or Outlook Express). Is it able to authenticate on that SMTP server?
 
 If the above doesn't help, please enable logging SMTP session into a file, reproduce the issue and provide us with the log file for examination. You can enable logging as follows:
 
 [C# syntax]
 
 
| Code: 
 
    
    | 
      
       | Smtp mailer = new Smtp();
 mailer.Log.Enabled = true;
 mailer.Log.Filename = @"C:\log.txt";
 |  |  |  
 [VB.NET syntax]
 
 
| Code: 
 
    
    | 
      
       | Dim mailer = New Smtp mailer.Log.Enabled = True
 mailer.Log.Filename = "C:\log.txt"
 |  |  |  
 Please make sure the application has permission to write into the specified location.
 
 You can send us the log file via Request Support Form.
 
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Anand Newbie
 
  
 
 Joined: 22 January 2008
 Location: New Zealand
 Online Status: Offline
 Posts: 2
 | 
          JFYI ..our mail server does not take any username or password.....please have a look at the code below...
           | Posted: 23 January 2008 at 2:50pm | IP Logged |   |  
           | 
 |  
 Actually, Development SMTP server requires Username & Password but Production server does not. Application is working fine in Development environment but we are facing problems in Production ( Where we are supplying username/passwords as blanks).
 
 C# - Code Looking for UserName/Password
 
 smtpMail.SmtpServers.Add(ConfigurationManager.AppSettings["MailServer"] .ToString(),                  ConfigurationManager.AppSettings["MailUserName"].ToString(), ConfigurationManager.AppSettings["MailPassword"].ToString());
 
 Web.config - Entry - In Production Environment
 <add key="MailUserName" value=""/>
 <add key="MailPassword" value=""/>
 <add key="MailServer" value="mailgate.nzpost.co.nz"/>
 
 Thanks;
 Anand
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Andrew AfterLogic Support
 
  
 
 Joined: 28 April 2006
 Location: United States
 Online Status: Offline
 Posts: 1189
 | 
          Please try to use this overload of SmtpServerCollection.Add method. It doesn't require credentials and doesn't perform SMTP authentication.
           | Posted: 24 January 2008 at 2:48am | IP Logged |   |  
           | 
 |  
 So, for production environment, the code would look like:
 
 
 
| Code: 
 
    
    | 
      
       | smtpMail.SmtpServers.Add(ConfigurationManager.AppSettings["MailServer"].ToString()); |  |  |  
 Best regards,
 Andrew
 | 
       
        | Back to Top |     | 
       
       
        |  |