SmtpMail.SmtpServer プロパティ

定義

電子メールを送信するために使用する SMTP メール リレー サーバーの名前を取得または設定します。 推奨する代替 : System.Net.Mail

public:
 static property System::String ^ SmtpServer { System::String ^ get(); void set(System::String ^ value); };
public static string SmtpServer { get; set; }
static member SmtpServer : string with get, set
Public Shared Property SmtpServer As String

プロパティ値

電子メール リレー サーバーの名前。

//This example assigns the name of the mail relay server on the 
//local network to the SmtpServer property.
SmtpMail.SmtpServer = "RelayServer.Contoso.com";
' This example assigns the name of the mail relay server on the 
' local network to the SmtpServer property.
SmtpMail.SmtpServer = "RelayServer.Contoso.com"

注釈

ローカル SMTP サーバー (Windows 2000 および Windows Server 2003 に含まれる) が、直接 SMTP トラフィック (ポート 25 経由) をブロックするファイアウォールの内側にある場合は、SMTP メッセージをインターネットに中継できるスマート ホストがネットワーク上にあるかどうかを確認する必要があります。

スマート ホストは、内部 SMTP サーバーから送信電子メール メッセージをインターネットに直接中継するアクセス許可を持つ SMTP サーバーです。 スマート ホストは、電子メール ゲートウェイとして機能するために、内部ネットワークとインターネットの両方に同時に接続できる必要があります。

適用対象