입니다 예를보십시오 (예 : here). 양식에 WebControl
을 추가하기 만하면됩니다.
Regex
을 사용하여 전자 메일 주소의 유효성을 검사하거나 다음을 시도 할 수 있습니다.
//NOTE: This code will not catch double periods, extra spaces. For more precision, stick to Regex.
public bool IsEmailValid(string emailAddress)
{
try
{
MailAddress m = new MailAddress(emailAddress);
return true;
}
catch (FormatException)
{
return false;
}
}
이메일 주소를 확인하는 Regex
방법 :
String email = "[email protected]";
Regex regex = new Regex(@"^[\w!#$%&'*+\-/=?\^_`{|}~]+(\.[\w!#$%&'*+\-/=?\^_`{|}~]+)*"
+ "@"
+ @"((([\-\w]+\.)+[a-zA-Z]{2,4})|(([0-9]{1,3}\.){3}[0-9]{1,3}))$";);
Match match = regex.Match(email);
if (match.Success)
//Email is has the right format.
else
//Email doesn't have the correct format.
하지만 당신의 목표는 Gmail과 통신 할 경우, 당신은 사용할 수 있도록해야합니다
GMAIL API를 - https://developers.google.com/gmail/
을
다른 (더 간단한) 접근 방식을 고려해보십시오. Windows Form을 사용하고 C# 코드에서 관련 HTTP 요청을 Gmail 서버로 보내십시오. 전혀 웹 페이지가 필요 없습니다. –
자세히 설명해 주시겠습니까 – Gaurav
정확한 요구 사항에 대해 알지 못하고 자세한 질문을 설명하는 이유를 알지 못하면 자세한 도움말을 제공하기가 어렵습니다. –