GrapeCity Secure Mail for .NET 4.0J
IMAPサーバーへ接続する

IMAPサーバーへ接続するには、Sessionクラスの各プロパティを設定したうえで、Connectメソッドを実行します。

その後にAuthenticateメソッドを実行すると、サーバーへのログインが行われます。

  • サンプルコードの先頭にある名前空間の参照文(Visual BasicではImports、C#ではusing)は、ソースファイルの先頭に記述してください。
  • 本トピック以降のサンプルコードでは、サーバー接続設定に関するコードの記載を省略している場合があります。
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();

 

 


© 2003, GrapeCity inc. All rights reserved.