/*****************************************************************
(C) Copyright DENTSPLY International. All rights reserved.
The use, disclosure, reproduction, modification, transfer, or
transmittal of this work for any purpose in any form or by any
means without written permission of DENTSPLY International is
strictly prohibited.
Created Date: 12/Jun/2013
Created By: Jimmy Xie[Tectura]
Helpdesk Ticket#: KP000115
Description of Behavior: Enables AX email validation functionality without Outlook
Expected Input: email parameters
Expected Output: validation the email message is correct
******************************************************************/
Static Server boolean validateEmail(EMail _eMail)
{
str emailPattern;
System.Text.RegularExpressions.Match myMatch;
Boolean isValid;
;
emailPattern = @"^(([\w-]+\.)+[\w-]+|([a-zA-Z]{1}|[\w-]{2,}))@"
+ @"((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
[0-9]{1,2}|25[0-5]|2[0-4][0-9])\."
+ @"([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\.([0-1]?
[0-9]{1,2}|25[0-5]|2[0-4][0-9])){1}|"
+ @"([a-zA-Z]+[\w-]+\.)+[a-zA-Z]{2,4})$";
new InteropPermission(InteropKind::ClrInterop).assert();
myMatch = System.Text.RegularExpressions.Regex::Match(_eMail, emailPattern);
isValid = myMatch.get_Success();
CodeAccessPermission::revertAssert();
return isValid;
}