MailMessage.From 属性

定义

获取或设置发件人的电子邮件地址。Gets or sets the email address of the sender. 建议使用的替代项:System.Net.MailRecommended alternative: System.Net.Mail.

public:
 property System::String ^ From { System::String ^ get(); void set(System::String ^ value); };
public string From { get; set; }
member this.From : string with get, set
Public Property From As String

属性值

String

发件人的电子邮件地址。The sender's email address.

示例

MailMessage MyMessage = new MailMessage();
MyMessage.From = "john@contoso.com";
Dim  MyMessage As MailMessage = New MailMessage()
MyMessage.From = "john@contoso.com"

适用于