GrapeCity Secure Mail for .NET 4.0J > メールの受信(IMAP) > IMAPサーバーへ接続する |
IMAPサーバーへ接続するには、Sessionクラスの各プロパティを設定したうえで、Connectメソッドを実行します。
その後にAuthenticateメソッドを実行すると、サーバーへのログインが行われます。
![]() |
|
Imports Dart.Mail Imports Dart.Mail.Imap ' 接続するIMAPサーバーとポート番号を指定します。 Imap1.Session.RemoteEndPoint = New Dart.Mail.IPEndPoint("imap.myMailServer.com", Imap.GetDefaultPort(Imap1.Session)) ' ユーザー名とパスワードを設定します。 Imap1.Session.Username = "myUsername" Imap1.Session.Password = "myPassword" ' IMAPサーバーに接続します。 Imap1.Connect() ' IMAPサーバーにログインします。 Imap1.Authenticate()
using Dart.Mail; using Dart.Mail.Imap; // 接続するIMAPサーバーとポート番号を指定します。 Imap1.Session.RemoteEndPoint = new Dart.Mail.IPEndPoint("imap.myMailServer.com", Imap.GetDefaultPort(Imap1.Session)); // ユーザー名とパスワードを設定します。 Imap1.Session.Username = "myUsername"; Imap1.Session.Password = "myPassword"; // IMAPサーバーに接続します。 Imap1.Connect(); // IMAPサーバーにログインします。 Imap1.Authenticate();