MailMessageEventArgs.Message 속성

정의

이메일 메시지 콘텐츠를 가져옵니다.

public:
 property System::Net::Mail::MailMessage ^ Message { System::Net::Mail::MailMessage ^ get(); };
public System.Net.Mail.MailMessage Message { get; }
member this.Message : System.Net.Mail.MailMessage
Public ReadOnly Property Message As MailMessage

속성 값

MailMessage

메시지 내용이 들어 있는 MailMessage입니다.

예제

다음 코드 예제를 사용 하는 방법에 설명 합니다 Message 전송 되기 전에 메시지의 내용을 변경 하려면 전자 메일 메시지 이벤트 처리기의 속성입니다.

<%@ page language="C#" %>
<%@ Import namespace="Samples.AspNet.CS.Controls" %>

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

  void Page_Init(object sender, EventArgs e)
  {
    PasswordRecoveryOnBeforeSendingEmail passwordRecoveryControl = 
      new PasswordRecoveryOnBeforeSendingEmail();

    passwordRecoveryControl.ID = "passwordRecoveryControl";
    passwordRecoveryControl.MailDefinition.From = "userAdmin@your.site.name.here";
    PlaceHolder1.Controls.Add(passwordRecoveryControl);

  }
</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:placeholder id="PlaceHolder1" runat="server"></asp:placeholder>
    </form>
  </body>
</html>
<%@ page language="VB" %>
<%@ Import namespace="Samples.AspNet.VB.Controls" %>

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

  Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
    
    Dim passwordRecoveryControl As New PasswordRecoveryOnBeforeSendingEmail
        
    passwordRecoveryControl.ID = "passwordRecoveryControl"
    passwordRecoveryControl.MailDefinition.From = "userAdmin@your.site.name.here"
    PlaceHolder1.Controls.Add(passwordRecoveryControl)
        
  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:placeholder id="PlaceHolder1" runat="server"></asp:placeholder>
    </form>
  </body>
</html>

설명

Message 속성에서 반환 된 MailMessage 전자 메일 메시지 데이터가 포함 된 개체. 합니다 Message 속성은 읽기 전용; 사용할 수 있습니다는 MailMessage 반환 전자 메일 메시지의 속성을 수정 하는 개체입니다.

적용 대상

추가 정보