| Author | 
         | 
         
      
        
         
         Cleber Guest Group 
          
 
  Joined: 10 November 2003
 Online Status: Online Posts: 262
          | 
        
         
          
           | Posted: 05 July 2006 at 9:53pm | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
hello,
 I'd like to know if Mailbee.net smtp can validate an e-mail address. So, for a e-mail address validation (special character's) and for a mx validation of domain (if exists) before send an e-mail.
 
 Thanks.
 
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Alex AfterLogic Support 
          
  
  Joined: 19 November 2003
 Online Status: Offline Posts: 2207
          | 
        
         
          
           | Posted: 06 July 2006 at 7:57am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
To validate recipient email address and check domain for MX record, you can use TestSend method of MailBee.NET SMTP component. This method performs a sending of mail message to the recipient without actual submitting of the message data and returns one of TestSendResult values. For instance, it returns BadRecipient value when recipient e-mail was refused by the SMTP server and NoMXRecord when no MX records have been found for a recipient domain.
 
 You can find detailed description of TestSend method and programming samples at MailBee.NET Objects documentation / Assembly Reference / MailBee.SmtpMail / Smtp Class / Methods / TestSend Method.
 
 Best regards, 
 Alex,
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Cleber Guest Group 
          
 
  Joined: 10 November 2003
 Online Status: Online Posts: 262
          | 
        
         
          
           | Posted: 06 July 2006 at 4:12pm | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
It's OK. It's work very well for me.
 
 So, I'd like to validate the e-mail address before and smtp conection, for example: xxx@!yahoo.com (it's invalid because the !). Have you other component to validate the email for a regex evaluation or other method?
 
 Other question is, using the Async, we can control the max. threat's connection? 
 
 Regards
 Cleber
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Alex AfterLogic Support 
          
  
  Joined: 19 November 2003
 Online Status: Offline Posts: 2207
          | 
        
         
          
           | Posted: 07 July 2006 at 8:29am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Quote: 
   
    
    
      
       
 So, I'd like to validate the e-mail address before and smtp conection
  | 
       
       | 
    
    | 
 
 
 You can use the following sample code to validate email address (in C# syntax):
 
 
Code: 
   
    
    
      
       
 // Set recipient address
 string email = "xxx@!yahoo.com";
 
 // Create a new Regex object.
 Regex r = new Regex(@"^([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9\-]+\.)+([a-zA-Z]{2,4})(\]?)$");
 
 // Find a single match in the string.
 Match m = r.Match(email);
 
 if (m.Success)
 {
    Console.WriteLine("Email address is valid");
 }
 else
 {
    Console.WriteLine("Email address is not valid");
 }
  | 
       
       | 
    
    | 
 
 
 
 
Quote: 
   
    
    
      
       
 Other question is, using the Async, we can control the max. threat's connection?
  | 
       
       | 
    
    | 
 
 
 We are not sure we clearly understood your question. Could you please clarify this in more detail?
 
 Best regards,
 Alex
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Cleber Guest Group 
          
 
  Joined: 10 November 2003
 Online Status: Online Posts: 262
          | 
        
         
          
           | Posted: 07 July 2006 at 10:10am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Hello Alex,
 
 About regex it's OK. Very Thanks! 
 
 About the Async, I look in the Smtp.MaxThreadCount Property documentation and the response is here :).
 
 Very Thanks for the Fast Response. After my test's and with sucess we buy the license.
 
 Best Regards
 Cleber
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Cleber Guest Group 
          
 
  Joined: 10 November 2003
 Online Status: Online Posts: 262
          | 
        
         
          
           | Posted: 10 July 2006 at 8:21pm | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Hello Alex,
 with a simple code, this errors occurs:
 
 InnerException message follows: Specified cast is not valid
 
 Do you know what is this?
 
 Best Regards
 Cleber Saad
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Alex AfterLogic Support 
          
  
  Joined: 19 November 2003
 Online Status: Offline Posts: 2207
          | 
        
         
          
           | Posted: 11 July 2006 at 7:03am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Could you please provide us with this simple code? Thus, we would be able to investigate the problem in mode detail.
 
 Best regards,
 Alex,
 
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Cleber Guest Group 
          
 
  Joined: 10 November 2003
 Online Status: Online Posts: 262
          | 
        
         
          
           | Posted: 11 July 2006 at 10:19am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
Hello Alex,
 
 I found the problem and fix it.
 
 Best Regards
         | 
       
       
        | Back to Top | 
         
          
         | 
       
       
       
        |   |