public async Task <IActionResult> SendMailToCheckMailAddress(string mail_address) { return(await CProxy.Using(() => { var _result = (success : false, message : "ok"); while (true) { if (String.IsNullOrEmpty(mail_address) == true) { _result.message = "메일 주소가 필요 합니다"; break; } var _member = __db_context.TbLionMember .Where(m => m.EmailAddress == mail_address) .SingleOrDefault(); if (_member != null && _member.IsAlive == true) { _result.message = $"입력하신 메일주소({mail_address})는 이미 사용 중 입니다."; break; } if (__smtp_direct.TestMailServerConnection2(MailSenderAddress, mail_address) == false) { _result.message = $"검증 하려고 하는 메일주소({mail_address})는 수신 가능 상태가 아닙니다."; break; } _result = SendMailCheckNumber(mail_address); break; } return new OkObjectResult(new { success = _result.success, message = _result.message, result = "" }); })); }
public bool TestMailServerConnection(TbLionMember member) { var _result = true; try { if (__smtp_direct.TestMailServerConnection2(MailSenderAddress, member.EmailAddress) == false) { member.MailError = true; _result = false; } } catch { member.MailError = true; _result = false; } return _result; }