Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: E-mail validation Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Cleber
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 05 July 2006 at 9:53pm | IP Logged Quote Cleber

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 View Cleber's Profile Search for other posts by Cleber
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 06 July 2006 at 7:57am | IP Logged Quote Alex

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 View Alex's Profile Search for other posts by Alex
 
Cleber
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 06 July 2006 at 4:12pm | IP Logged Quote Cleber

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 View Cleber's Profile Search for other posts by Cleber
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 07 July 2006 at 8:29am | IP Logged Quote Alex

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 View Alex's Profile Search for other posts by Alex
 
Cleber
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 07 July 2006 at 10:10am | IP Logged Quote Cleber

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 View Cleber's Profile Search for other posts by Cleber
 
Cleber
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 10 July 2006 at 8:21pm | IP Logged Quote Cleber

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 View Cleber's Profile Search for other posts by Cleber
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 11 July 2006 at 7:03am | IP Logged Quote Alex

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 View Alex's Profile Search for other posts by Alex
 
Cleber
Guest Group
Guest Group


Joined: 10 November 2003
Online Status: Online
Posts: 262
Posted: 11 July 2006 at 10:19am | IP Logged Quote Cleber

Hello Alex,

I found the problem and fix it.

Best Regards
Back to Top View Cleber's Profile Search for other posts by Cleber
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide