PasswordRecovery.SendingMail 이벤트

정의

사용자에게 이메일로 암호를 보내기 전에 발생합니다.

public:
 event System::Web::UI::WebControls::MailMessageEventHandler ^ SendingMail;
public event System.Web.UI.WebControls.MailMessageEventHandler SendingMail;
member this.SendingMail : System.Web.UI.WebControls.MailMessageEventHandler 
Public Custom Event SendingMail As MailMessageEventHandler 

이벤트 유형

예제

다음 코드 예제에서는 합니다 SendingMail 속성을 설정 하는 이벤트는 MailMessage 전자 메일 메시지를 포함 하는 개체입니다.

<%@ page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  void PasswordRecovery1_SendingMail(object sender, MailMessageEventArgs e)
  {
    e.Message.IsBodyHtml = false;
    e.Message.Subject = "New password on Web site.";
  }
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <asp:passwordrecovery 
         id="PasswordRecovery1" 
         runat="server"
         maildefinition-from="userAdmin@your.site.name.here"
         onsendingmail="PasswordRecovery1_SendingMail">
      </asp:passwordrecovery>
    </form>
  </body>
</html>
<%@ page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

  Sub PasswordRecovery1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs)

    e.Message.IsBodyHtml = False
    e.Message.Subject = "New password on Web site."
    
  End Sub
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <asp:passwordrecovery
         id="PasswordRecovery1" 
         runat="server" 
         maildefinition-from="userAdmin@your.site.name.here"
         onsendingmail="PasswordRecovery1_SendingMail">
      </asp:passwordrecovery>
    </form>
  </body>
</html>

설명

SendingMail 사용자 새롭거나 복구 암호를 요청 하 고 (멤버 자격 공급자에 지 원하는 경우 암호 질문 및 답변) 암호 확인 질문에 대 한 올바른 답을 제출 하지만 암호를 보내기 전에 서버에서 이벤트가 발생 사용자 전자 메일에 있습니다. 이 이벤트를 사용 하 여 설정 하는 등의 전자 메일 메시지를 보내기 전에 필요한 특별 한 처리를 위해 MailMessage 속성입니다.

사용자가 올바른 사용자 이름을 입력 하 고, 해당 되는 경우 유효한 응답을 합니다 PasswordRecovery 를 발생 시킵니다는 SendingMail 이벤트 암호 정보를 전자 메일로 사용자에 게 보냅니다. 전자 메일에 정의 된 설정을 사용 하 여 <smtpMail> 구성 파일 요소입니다.

이벤트를 처리 하는 방법에 대 한 자세한 내용은 참조 하세요. 이벤트 처리 및 발생합니다.

적용 대상

추가 정보