C# Class nMail.Imap4

IMAP4rev1 ���[����M�N���X

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�� MIME �\����擾���A�e�L�X�g�ł���Ζ{����\���A�Y�t�t�@�C���ł���� z:\temp �ɕۑ����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); // MIME �\����擾 imap.GetMimeStructure(no); nMail.Imap4.MimeStructureStatus [] list = imap4.GetMimeStructureList() foreach(nMail.Imap4.MimeStructureStatus mime in list) { // �e�L�X�g�ł���Ζ{����擾���ĕ\�� if(string.Compare(mime.Type, "text", true) == 0 && string.Compare(mime.SubType, "plain", true) == 0) { // �{���擾 imap.GetMimePart(no, mime.PartNo); MessageBox.Show(imap.Body); } else if(string.Compare(mime.Type, "multipart", true) != 0) { // �Y�t�t�@�C����ۑ� imap.SaveMimePart(no, mime.PartNo, @"z:\temp\" + mime.FileName); } } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") ' MIME �\����擾 imap.GetMimeStructure(no) Dim list As nMail.Imap4.MimeStructureStatus() = imap4.GetMimeStructureList() For Each mime As nMail.Imap4.MimeStructureStatus In list ' �e�L�X�g�ł���Ζ{����擾���ĕ\�� If (String.Compare(mime.Type, "text", True) = 0) And (String.Compare(mime.SubType, "plain", True) = 0) Then ' �{���擾 imap.GetMimePart(no, mime.PartNo) MessageBox.Show(imap.Body) Else If String.Compare(mime.Type, "multipart", true) <> 0 Then ' �Y�t�t�@�C����ۑ� imap.SaveMimePart(no, mime.PartNo, "z:\temp\" + mime.FileName) End If Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)��擾���A�����Ɩ{����\������B ��ق� Attachment �N���X�œY�t�t�@�C����W�J����ꍇ���� text/html �p�[�g��t�@�C���ɕۑ��������ꍇ�A Options.DisableDecodeBodyText() ������� Options.DisableDecodeBodyAll()��Ă�ł���GetMail�Ŏ擾�����w�b�_����і{���f�[�^��g�p����K�v������܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetMail(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, imap.Subject, imap.Body)); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, imap.Subject, imap.Body)) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

STARTTLS ��g�p���ă��[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)��擾���A�����Ɩ{����\������B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.SSL = nMail.Imap4.STARTTLS; imap.Connect(); // STARTTLS �̏ꍇ�ʏ�� IMAP4 �|�[�g�ԍ��Őڑ� imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetMail(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, imap.Subject, imap.Body)); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.SSL = nMail.Imap4.STARTTLS imap.Connect() ' STARTTLS �̏ꍇ�ʏ�� IMAP4 �|�[�g�ԍ��Őڑ� imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, imap.Subject, imap.Body)) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)��擾���A�����Ɩ{����\������B�Y�t�t�@�C���� z:\temp �ɕۑ�����B text/html �p�[�g��t�@�C���ɕۑ�����ꍇ�AGetMail �̑O�� Options.EnableSaveHtmlFile() ��Ă�ł����K�v������܂��B �ۑ����� text/html �p�[�g�̃t�@�C������ HtmlFile �Ŏ擾�ł��܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Path = @"z:\temp"; imap.GetMail(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, imap.Subject, imap.Body)); string [] file_list = imape.GetFileNameList(); if(file_list.Length == 0) { MessageBox.Show("�t�@�C���͂���܂���"); } else { foreach(string name in file_list) { MessageBox.Show(String.Format("�Y�t�t�@�C����:{0:s}", name)); } } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Path = "z:\temp" imap.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, imap.Subject, imap.Body)) Dim file_list As String() = imap.GetFileNameList() If file_list.Length = 0 Then MessageBox.Show("�t�@�C���͂���܂���") Else For Each name As String In file_list MessageBox.Show(String.Format("�Y�t�t�@�C����:{0:s}", name)) Next fno End If Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

�ꎞ�x�~�@�\��g���ă��[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)��擾���A�����Ɩ{����\������B�Y�t�t�@�C���� z:\temp �ɕۑ�����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); // ���������̋x�~�񐔂𓾂� int count = imap.GetSize(no) / (nMail.Options.SuspendSize * 1024) + 1; imap.Path = @"z:\temp"; imap.GetMail(no); imap.Flag = nMail.Imap4.SuspendAttachmentFile; imap.GetMail(no); imap.Flag = nMail.Imap4.SuspendNext; while(imap.ErrorCode == nMail.Imap4.ErrorSuspendAttachmentFile) { imap.GetMail(no); // �v���O���X�o�[��i�߂铙�̏��� Application.DoEvents(); } MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, imap.Subject, imap.Body)); string [] file_list = imape.GetFileNameList(); if(file_list.Length == 0) { MessageBox.Show("�t�@�C���͂���܂���"); } else { foreach(string name in file_list) { MessageBox.Show(String.Format("�Y�t�t�@�C����:{0:s}", name)); } } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try Dim count As Integer imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox"); ' ���������̋x�~�񐔂𓾂� count = imap.GetSize(no) \ (nMail.Options.SuspendSize * 1024) + 1 imap.Path = "z:\temp" imap.Flag = nMail.Imap4.SuspendAttachmentFile imap.GetMail(no) imap.Flag = nMail.Imap4.SuspendNext Do While imap.ErrorCode = nMail.Imap4.ErrorSuspendAttachmentFile imap.GetMail(no) ' �v���O���X�o�[��i�߂铙�̏��� Application.DoEvents() Loop MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, imap.Subject, imap.Body)) Dim file_list As String() = imap.GetFileNameList() If file_list.Length = 0 Then MessageBox.Show("�t�@�C���͂���܂���") Else For Each name As String In file_list MessageBox.Show(String.Format("�Y�t�t�@�C����:{0:s}", name)) Next fno End If Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

Inheritance: IDisposable
Afficher le fichier Open project: hijirichan/AkaneMail

Protected Properties

Свойство Type Description
_body StringBuilder
_body_size int
_cert_name string
_count int
_date StringBuilder
_err int
_field StringBuilder
_field_name string
_filename StringBuilder
_filename_list string[]
_flag int
_from StringBuilder
_header StringBuilder
_header_size int
_host string
_html_file StringBuilder
_id string
_mailbox string
_mailbox_list MailBoxStatus[]
_message_flag int
_mime_flag int
_mime_list MimeStructureStatus[]
_mode int
_namespace_list NameSpaceStatus[][]
_password string
_path string
_port int
_rfc822_file StringBuilder
_search_first_flag bool
_search_list uint[]
_size int
_socket IntPtr
_ssl int
_subject StringBuilder
_uid uint
_useuid int
_useuid_flag bool

Méthodes publiques

Méthode Description
AddMessageFlag ( uint no, int message_flag ) : void

���[�����b�Z�[�W�t���O��t�����܂��B

�w�肵�����b�Z�[�W�t���O��t�����܂��B�w�肵�Ă��Ȃ��t���O�̏�Ԃ͂��̂܂܂ł��B

�t���O�t�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�ɕԐM�ς݃t���O��t�����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddMessageFlag(no, nMail.Imap4.MessageAnswerd); // �ԐM�ς݃t���O�t�� } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddMessageFlag(no, nMail.Imap4.MessageAnswerd) ' �ԐM�ς݃t���O�t�� Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

AddSearchAnd ( int type ) : void

���[���̌��� AND (������)

AND �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̊��ǂ̃��[���� 2009/8/1 �ȍ~�ɓ����������[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchAnd(SearchSeen); imap.Search(SearchSince, MakeDateString(new DateTime(2009, 8, 1)); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchAnd(SearchSeen) imap.Search(SearchSince, MakeDateString(new DateTime(2009, 8, 1)) Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

AddSearchAnd ( int type, string text ) : void

���[���̌��� AND (������L)

AND �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̌�����"�e�X�g"���܂܂�A���o�l(From �t�B�[���h)�� [email protected] ���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchAnd(SearchSubject, "�e�X�g"); imap.Search(SearchFrom, "[email protected]"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchAnd(SearchSubject, "�e�X�g") imap.Search(SearchFrom, "[email protected]") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

AddSearchOr ( int type ) : void

���[���̌��� OR (������)

OR �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̊��ǂ̃��[�����A�܂��͌�����"�e�X�g"���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchOr(SearchSeen); imap.Search(SearchSubject, "�e�X�g"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchOr(SearchSeen) imap.Search(SearchSubject, "�e�X�g") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

AddSearchOr ( int type, string text ) : void

���[���̌��� OR (������L)

OR �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̌�����"�e�X�g"���܂܂�邩�A�܂��͍��o�l(From �t�B�[���h)�� [email protected] ���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchOr(SearchSubject, "�e�X�g"); imap.Search(SearchFrom, "[email protected]"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchOr(SearchSubject, "�e�X�g") imap.Search(SearchFrom, "[email protected]") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

AppendMail ( string mailbox, string header, string body, int message_flag ) : void

���[���{�b�N�X�Ƀ��[����A�b�v���[�h���܂��B

���M�σ��[���{�b�N�X("sent")�Ƀ��[������ǃt���O�t���ŃA�b�v���[�h����B subject �Ɍ����Afrom �ɍ��o�l�Ato �Ɉ���Abody �Ƀ��[���{���������Ă����̂Ƃ���B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { string header; try { imap.Connect(); imap.Authenticate("imap4_id", "password"); header = "Subject: " + subject + "\r\n"; header += "From: " + from + "\r\n"; header += "To: " + to + "\r\n"; imap.AppendMail("sent", header, body, MessageSeen); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Dim header As String Try imap.Connect() imap.Authenticate("imap4_id", "password") header = "Subject: " + subject + ControlChars.CrLf header += "From: " + from + ControlChars.CrLf header += "To: " + to + ControlChars.CrLf imap.AppendMail("sent", header, body, MessageSeen) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

AppendMail ( string mailbox, string header, string body, int message_flag, string path ) : void

���[���{�b�N�X�Ƀ��[����A�b�v���[�h���܂��B

���M�σ��[���{�b�N�X("sent")�Ƀ��[������ǃt���O�t���ŃA�b�v���[�h����B subject �Ɍ����Afrom �ɍ��o�l�Ato �Ɉ���Abody �Ƀ��[���{���Apath �ɓY�t�t�@�C���̃p�X���������Ă����̂Ƃ���B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { string header; try { imap.Connect(); imap.Authenticate("imap4_id", "password"); header = "Subject: " + subject + "\r\n"; header += "From: " + from + "\r\n"; header += "To: " + to + "\r\n"; imap.AppendMail("sent", header, body, MessageSeen, path); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Dim header As String Try imap.Connect() imap.Authenticate("imap4_id", "password") header = "Subject: " + subject + ControlChars.CrLf header += "From: " + from + ControlChars.CrLf header += "To: " + to + ControlChars.CrLf imap.AppendMail("sent", header, body, MessageSeen, path) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

Authenticate ( string id_str, string pass_str ) : void

IMAP4 �T�[�o�F�؂�s���܂��B

ID �ƃp�X���[�h��w�肵�� IMAP4 �T�[�o�F�؂�s���܂��B

Authenticate ( string id_str, string pass_str, int mode ) : void

IMAP4 �T�[�o�F�؂�s���܂��B

ID�A�p�X���[�h����єF�،`����w�肵�� IMAP4 �T�[�o�F�؂�s���܂��B

Close ( ) : void

IMAP4 �T�[�o�Ƃ̐ڑ���I�����܂��B

CloseMailBox ( ) : void

���[���{�b�N�X�̑I���I�����܂��B

���[���{�b�N�X�̑I���I�����܂��B

���[���{�b�N�X�̑I��I�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

Connect ( ) : void

IMAP4 �T�[�o�ɐڑ����܂��B

IMAP4 �T�[�o�ɐڑ����܂��B

Connect ( int port_no ) : void

IMAP4 �T�[�o�ɐڑ����܂��B

�|�[�g�ԍ���w�肵�� IMAP4 �T�[�o�ɐڑ����܂��B

Connect ( string host_name ) : void

IMAP4 �T�[�o�ɐڑ����܂��B

�T�[�o����w�肵�� IMAP4 �T�[�o�ɐڑ����܂��B

Connect ( string host_name, int port_no ) : void

IMAP4 �T�[�o�ɐڑ����܂��B

�T�[�o���ƃ|�[�g�ԍ���w�肵�� IMAP4 �T�[�o�ɐڑ����܂��B

Copy ( uint no, string mailbox ) : void

���[����R�s�[���܂��B

���ݑI�����Ă��郁�[���{�b�N�X�̃��[����w��̃��[���{�b�N�X�ɃR�s�[���܂��B

CreateMailBox ( string mailbox ) : void

���[���{�b�N�X��쐬���܂��B

���[���{�b�N�X��쐬���܂��B

DecodeHeaderField ( string field ) : string

MIME �w�b�_�t�B�[���h�̕������f�R�[�h���܂�

Delete ( uint no ) : void

���[���̍폜�}�[�N��t�����܂��B ���ۂ̍폜��Expunge���\�b�h��Ăяo�����ۂɍs���܂��B

���[���폜�}�[�N�t�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�ɍ폜�}�[�N��t�����A���ۂɍ폜���܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Delete(no); // �폜�}�[�N�t�� imap.Expunge(); // �폜���s MessageBox.Show(String.Format("���[���ԍ�:{0:d}��폜����", no)); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Delete(no) ' �폜�}�[�N�t�� imap.Expunge() ' �폜���s MessageBox.Show(String.Format("���[���ԍ�:{0:d}��폜����", no)) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

DeleteMailBox ( string mailbox ) : void

���[���{�b�N�X��폜���܂��B

���[���{�b�N�X��폜���܂��B

DeleteMessageFlag ( uint no, int message_flag ) : void

���[�����b�Z�[�W�t���O��폜���܂��B

�w�肵�����b�Z�[�W�t���O��폜���܂��B�w�肵�Ă��Ȃ��t���O�̏�Ԃ͂��̂܂܂ł��B

���[�����b�Z�[�W�t���O�t�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)����폜�}�[�N�t���O��폜���܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.DeleteMessageFlag(no, nMail.Imap4.MessageDeleted); // �폜�}�[�N�t���O�폜 } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.DeleteMessageFlag(no, nMail.Imap4.MessageDeleted) ' �폜�}�[�N�t���O�폜 Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

Dispose ( ) : void

Imap4�ɂ���Ďg�p����Ă��邷�ׂẴ��\�[�X�������܂��B

Expunge ( ) : void

�폜�}�[�N�̂‚��Ă��郁�[����폜���܂��B

�폜�}�[�N�̂‚��Ă��郁�[����폜���܂��B

���[���폜���s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

GetAttachmentFileStatus ( uint no ) : bool

�Y�t�t�@�C���̑��݃`�F�b�N��s���܂��B

��������Ă��郁�[���ɂ‚��Ă͈�x��M��AAttachment �N���X�Ō������Ă��������B

GetDecodeHeaderField ( string field_name ) : string

���[���w�b�_����w��̃w�b�_�t�B�[���h�̓�e��擾���A MIME �w�b�_�t�B�[���h�̃f�R�[�h��s���ĕԂ��܂�

GetDecodeHeaderField ( string field_name, string header ) : string

���[���w�b�_����w��̃w�b�_�t�B�[���h�̓�e��擾���A MIME �w�b�_�t�B�[���h�̃f�R�[�h��s���ĕԂ��܂�

GetFileNameList ( ) : string[]

�Y�t�t�@�C�����̔z���擾���܂��B

GetHeaderField ( string field_name ) : string

���[���w�b�_����w��̃t�B�[���h�̓�e��擾���܂��B

IMAP4 �T�[�o�Ƃ̐ڑ��Ƃ͖��֌W�Ɏg�p�ł��܂��B

�w�b�_�́AHeader�Őݒ肵�Ă����܂��B GetMail�Ŏ�M��������ɌĂяo�����ꍇ�A ��M�������[���̃w�b�_��g�p���܂��B

�擾�����t�B�[���h��e��Field�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ�:no)�� X-Mailer �w�b�_�t�B�[���h��擾����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetMail(no); MessageBox.Show("X-Mailer:" + imap.GetHeaderField("X-Mailer:")); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception e) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetMail(no) MessageBox.Show("X-Mailer:" + imap.GetHeaderField("X-Mailer:")) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

GetHeaderField ( string field_name, string header ) : string

���[���w�b�_����w��̃t�B�[���h�̓�e��擾���܂��B

GetMail ( uint no ) : void

���[����擾���܂��B

no�p�����[�^�Ń��[����擾���������[���ԍ���w�肵�܂��B

�Y�t�t�@�C����ۑ��������ꍇ�APath�ɕۑ��������t�H���_��w�肵�Ă����܂��B

�g���@�\��g�p�������ꍇ�AFlag�Őݒ肵�Ă����܂��B

������Subject�Ŏ擾�ł��܂��B

���t�������DateString�Ŏ擾�ł��܂��B

���o�l��From�Ŏ擾�ł��܂��B

�w�b�_��Header�Ŏ擾�ł��܂��B

���[���T�C�Y��Size�Ŏ擾�ł��܂��B

�Y�t�t�@�C������FileName�Ŏ擾�ł��܂��B

GetMailBoxList ( string refer, string mailbox ) : void

���[���{�b�N�X�̈ꗗ��擾���܂��B

���[���{�b�N�X�̈ꗗ��擾���܂��B�ꗗ��GetMailBoxList �Ŏ擾�ł��܂��B

�S�Ẵ��[���{�b�N�X�̈ꗗ��\�����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); // ���[���{�b�N�X�ꗗ��擾 imap.GetMailBoxList("", "*"); nMail.Imap4.MailBoxStatus [] list = imap4.GetMailBoxStatusList() foreach(nMail.Imap4.MailBoxStatus mailbox in list) { MessageBox.Show(string.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)); } } catch(nMail.nMailException nex) { MessageBox.Show(string.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(string.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") ' ���[���{�b�N�X�ꗗ��擾 imap.GetMailBoxList("", "*") Dim list As nMail.Imap4.MailBoxStatus() = imap4.GetMailBoxList() For Each mailbox As nMail.Imap4.MailBoxStatus In list MessageBox.Show(String.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)) Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

GetMailBoxListSubscribe ( string refer, string mailbox ) : void

�w�Ǎς݃��[���{�b�N�X�̈ꗗ��擾���܂��B

�w�Ǎς݃��[���{�b�N�X�̈ꗗ��擾���܂��B�ꗗ��GetMailBoxStatusList �Ŏ擾�ł��܂��B�B

�S�Ă̍w�Ǎς݃��[���{�b�N�X�̈ꗗ��\�����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); // �w�Ǎς݃��[���{�b�N�X�ꗗ��擾 imap.GetMailBoxListSubscribe("", "*"); nMail.Imap4.MailBoxStatus [] list = imap4.GetMailBoxStatusList() foreach(nMail.Imap4.MailBoxStatus mailbox in list) { MessageBox.Show(string.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)); } } catch(nMail.nMailException nex) { MessageBox.Show(string.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(string.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") ' �w�Ǎς݃��[���{�b�N�X�ꗗ��擾 imap.GetMailBoxListSubscribe("", "*") Dim list As nMail.Imap4.MailBoxStatus() = imap4.GetMailBoxList() For Each mailbox As nMail.Imap4.MailBoxStatus In list MessageBox.Show(String.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)) Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

GetMailBoxMessageCount ( string mailbox ) : int

���[���{�b�N�X�̃��b�Z�[�W������擾���܂��B

mailbox�p�����[�^�Ń��b�Z�[�W������擾���������[���{�b�N�X����w�肵�܂��B

GetMailBoxNextUid ( string mailbox ) : uint

���[���{�b�N�X�̐V�������b�Z�[�W�� UID ��擾���܂��B

mailbox�p�����[�^�ŐV�������b�Z�[�W�� UID �l��擾���������[���{�b�N�X����w�肵�܂��B

GetMailBoxRecentCount ( string mailbox ) : int

���[���{�b�N�X�̐V�����b�Z�[�W����擾���܂��B

mailbox�p�����[�^�ŐV�����b�Z�[�W����擾���������[���{�b�N�X����w�肵�܂��B

GetMailBoxStatusList ( ) : MailBoxStatus[]

���[���{�b�N�X���̔z���擾���܂��B

GetMailBoxUidValidity ( string mailbox ) : uint

���[���{�b�N�X�� UID Validity �l��擾���܂��B

mailbox�p�����[�^�� UID Validity �l��擾���������[���{�b�N�X����w�肵�܂��B

GetMailBoxUnSeen ( string mailbox ) : int

���[���{�b�N�X�̖��ǃ��b�Z�[�W����擾���܂��B

mailbox�p�����[�^�Ŗ��ǃ��b�Z�[�W����擾���������[���{�b�N�X����w�肵�܂��B

GetMimePart ( uint no, int part_no ) : void

MIME �p�[�g��擾

���ǃt���O�𗧂ĂȂ��ꍇ�A�f�R�[�h���Ȃ��ꍇ�́AMimeFlag�Őݒ肵�Ă����܂��B

�擾�����p�[�g�{����Body�Ŏ擾�ł��܂��B

�T���v���� GetMimeStructure��Q�Ƃ��Ă��������B

GetMimePartHeader ( uint no, int part_no ) : void

MIME �p�[�g�w�b�_��擾

���ǃt���O�𗧂ĂȂ��ꍇ�A�f�R�[�h���Ȃ��ꍇ�́AMimeFlag�Őݒ肵�Ă����܂��B

�擾�����p�[�g�w�b�_��Header�Ŏ擾�ł��܂��B

�T���v���� GetMimeStructure��Q�Ƃ��Ă��������B

GetMimeStructure ( uint no ) : void

MIME �\����擾���܂��B

MIME �\����GetMimeStructureStatusList�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�� MIME �\����擾���A�e�L�X�g�ł���Ζ{����\���A�Y�t�t�@�C���ł���� z:\temp �ɕۑ����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); // MIME �\����擾 imap.GetMimeStructure(no); nMail.Imap4.MimeStructureStatus [] list = imap4.GetMimeStructureStatusList() foreach(nMail.Imap4.MimeStructureStatus mime in list) { // �e�L�X�g�ł���Ζ{����擾���ĕ\�� if(string.Compare(mime.Type, "text", true) == 0 && string.Compare(mime.SubType, "plain", true) == 0) { // �{���擾 imap.GetMimePart(no, mime.PartNo); MessageBox.Show(imap.Body); } else if(string.Compare(mime.Type, "multipart", true) != 0) { // �Y�t�t�@�C����ۑ� imap.SaveMimePart(no, mime.PartNo, @"z:\temp\" + mime.FileName); } } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") ' MIME �\����擾 imap.GetMimeStructure(no) Dim list As nMail.Imap4.MimeStructureStatus() = imap4.GetMimeStructureList() For Each mime As nMail.Imap4.MimeStructureStatus In list ' �e�L�X�g�ł���Ζ{����擾���ĕ\�� If (String.Compare(mime.Type, "text", True) = 0) And (String.Compare(mime.SubType, "plain", True) = 0) Then ' �{���擾 imap.GetMimePart(no, mime.PartNo) MessageBox.Show(imap.Body) Else If String.Compare(mime.Type, "multipart", true) <> 0 Then ' �Y�t�t�@�C����ۑ� imap.SaveMimePart(no, mime.PartNo, "z:\temp\" + mime.FileName) End If Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

GetMimeStructureStatusList ( ) : MimeStructureStatus[]

MIME �\���̔z���擾���܂��B

GetNameSpace ( ) : void

���O��Ԃ�擾���܂��B

���O��Ԃ�擾���A�\������B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { string header; try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.GetNameSpace(); nMail.Imap4.NameSpaceStatus [] list = imap.GetNameSpacePersonalStatusList() foreach(nMail.Imap4.NameSpaceStatus item in list) { MessageBox.Show(string.Format("�l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)); } list = imap.GetNameSpaceOtherStatusList() foreach(nMail.Imap4.NameSpaceStatus item in list) { MessageBox.Show(string.Format("���l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)); } list = imap.GetNameSpaceSharedStatusList() foreach(nMail.Imap4.NameSpaceStatus item in list) { MessageBox.Show(string.Format("���L���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Dim header As String Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.GetNameSpace() Dim list As nMail.Imap4.NameSpaceStatus() = imap.GetNameSpacePersonalStatusList() For Each item As nMail.Imap4.NameSpaceStatus In list MessageBox.Show(String.Format("�l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)) Next list = imap.GetNameSpaceOtherStatusList() For Each item As nMail.Imap4.NameSpaceStatus In list MessageBox.Show(String.Format("���l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)) Next list = imap.GetNameSpaceSharedStatusList() For Each item As nMail.Imap4.NameSpaceStatus In list MessageBox.Show(String.Format("���L���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)) Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

GetNameSpaceOtherStatusList ( ) : NameSpaceStatus[]

���l���O��Ԃ̔z���擾���܂��B

GetNameSpace���s��ɌĂяo���K�v������܂��B

GetNameSpacePersonalStatusList ( ) : NameSpaceStatus[]

�l���O��Ԃ̔z���擾���܂��B

GetNameSpace���s��ɌĂяo���K�v������܂��B

GetNameSpaceSharedStatusList ( ) : NameSpaceStatus[]

���L���O��Ԃ̔z���擾���܂��B

GetNameSpace���s��ɌĂяo���K�v������܂��B

GetSearchMailResultList ( ) : uint[]

�������ʂ̔z���擾���܂��B

GetSize ( uint no ) : int

���[���̃T�C�Y��擾���܂��B

no�p�����[�^�Ń��[���T�C�Y��擾���������[���ԍ���w�肵�܂��B

���[���{�b�N�X("inbox")��̃��[���ԍ�(�ϐ���:no)�̃��[���T�C�Y��擾����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetSize(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, imap.Size)); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, imap.Size)) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

GetStatus ( uint no ) : void

���[���̃X�e�[�^�X��擾���܂��B

no�p�����[�^�ŃX�e�[�^�X��擾���������[���ԍ���w�肵�܂��B

������Subject�Ŏ擾�ł��܂��B

���t�������DateString�Ŏ擾�ł��܂��B

���o�l��From�Ŏ擾�ł��܂��B

�w�b�_��Header�Ŏ擾�ł��܂��B

���b�Z�[�W�t���O��MessageFlag�Ŏ擾�ł��܂��B

�X�e�[�^�X�擾���s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

GetUid ( uint no ) : uint

���[���� UID ��擾���܂��B

�擾���� UID �͕Ԓl������� Uid�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�� UID ��擾����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetUid(no); MessageBox.Show("Uid=" + imap.Uid.ToString()); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetUid(no) MessageBox.Show("Uid=" + imap.Uid.ToString()) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

Imap4 ( ) : System

Imap4�N���X�̐V�K�C���X�^���X����������܂��B

Imap4 ( string host_name ) : System

Imap4�N���X�̐V�K�C���X�^���X����������܂��B

IsConnected ( ) : bool

�T�[�o�ɐڑ��������肷��

MakeAppendDateString ( DateTime tm ) : string

AppenMail�p�����w�蕶�����쐬���܂��B

�����w�蕶�����쐬���܂��B

AppendMail�p ��: "09-Jul-2009 15:10:30"

�����̂Ƃ��� AppendMail �ŃA�b�v���[�h����ۂ̃T�[�o������I�Ɏ��“����w��ɂ�

�@Imap4 �N���X�̃��\�b�h�ł͑Ή����Ă��܂���B

�@Date �w�b�_�t�B�[���h�̒l�� MakeFieldDateString �ō쐬���ĕt�����邱�Ƃ��ł��܂��B

MakeFieldDateString ( DateTime tm ) : string

Date �w�b�_�t�B�[���h�p�����w�蕶�����쐬���܂��B

�����w�蕶�����쐬���܂��B

Date �w�b�_�t�B�[���h�p ��: "Thu, 9 Jul 2009 15:10:30 +09:00"

AppendMail �Ŏw��̓����� Date �w�b�_�t�B�[���h��t���������ꍇ�Ɏg�p���܂��B

MakeSearchDateString ( DateTime tm ) : string

�����p���t�w�蕶�����쐬���܂��B

���t�w�蕶�����쐬���܂��B

�����p ��: "09-Jul-2009"

���[���{�b�N�X("inbox")��� 2009/8/1 �ɓ����������[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Search(SearchOn, MakeSearchDateString(new DateTime(2009, 8, 1)); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Search(SearchOn, MakeSearchDateString(new DateTime(2009, 8, 1)) Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

NoOperation ( ) : void

�Ȃɂ���s���܂���

�T�[�o�Ƃ̐ڑ��^�C���A�E�g�h�~���Ɏg�p���܂��B

RenameMailBox ( string old_name, string new_name ) : void

���[���{�b�N�X����ύX���܂��B

���[���{�b�N�X����ύX���܂��B

ReplaceMessageFlag ( uint no, int message_flag ) : void

���[�����b�Z�[�W�t���O��u�������܂��B

�w�肵�����b�Z�[�W�t���O�Œu�������܂��B

���[�����b�Z�[�W�t���O�u���������s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)����ǂ���яd�v���b�Z�[�W�t���O���t���Ă����ԂƂ��܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.ReplaceMessageFlag(no, nMail.Imap4.MessageFlagged | nMail.Imap4.MessageSeen); // ���ǂ���яd�v���t���O } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.ReplaceMessageFlag(no, nMail.Imap4.MessageFlagged Or nMail.Imap4.MessageSeen) ' ���Njy�яd�v���t���O Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

SaveMimePart ( uint no, int part_no, string path ) : void

MIME �p�[�g��ۑ�

���ǃt���O�𗧂ĂȂ��ꍇ�A�f�R�[�h���Ȃ��ꍇ�́AMimeFlag�Őݒ肵�Ă����܂��B

�ۑ������t�@�C������FileName�Ŏ擾�ł��܂��B

�T���v���� GetMimeStructure��Q�Ƃ��Ă��������B

Content-Type �̃^�C�v�� "multipart" �� MIME �p�[�g��w�肵���ꍇ�A�G���[�ɂȂ�܂��̂ł����Ӊ������B

Search ( int type ) : void

���[���̌������s(������)

�������ʂ� GetSearchMailResultList �Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̐V�K�̃��[��(�����t���O�L�肩�Š��ǃt���O�Ȃ�)��������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Search(SearchNew); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Search(SearchNew) Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

Search ( int type, string text ) : void

���[���̌������s(������L)

�������ʂ� GetSearchMailResultList �Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̍��o�l(From �t�B�[���h)�� [email protected] ���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Search(SearchFrom, "[email protected]"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Search(SearchFrom, "[email protected]") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

SelectMailBox ( string mailbox ) : void

���[���{�b�N�X��I����܂��B

mailbox�p�����[�^�őI����������[���{�b�N�X����w�肵�܂��B

SelectMailBoxReadOnly ( string mailbox ) : void

���[���{�b�N�X��ǂݏo����p�őI����܂��B

mailbox�p�����[�^�œǂݏo����p�őI����������[���{�b�N�X����w�肵�܂��B

SubscribeMailBox ( string mailbox ) : void

���[���{�b�N�X��w�ǂ��܂��B

���[���{�b�N�X��w�ǂ��܂��B

UnsubscribeMailBox ( string mailbox ) : void

���[���{�b�N�X�̍w�ǂ������܂��B

���[���{�b�N�X�̍w�ǂ������܂��B

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Imap4�ɂ���Ďg�p����Ă��邷�ׂẴ��\�[�X�������܂��B

Init ( ) : void

�����������ł��B

SetHeaderSize ( ) : void

�w�b�_�i�[�p�o�b�t�@�̃T�C�Y����肵�܂��B

Private Methods

Méthode Description
Imap4AppendMail ( IntPtr Socket, string MailBox, string Header, string Body, string Path, int MessageFlag, string DateString, int Flag ) : int
Imap4Authenticate ( IntPtr Socket, string Id, string Pass, int Mode ) : int
Imap4ChangeMessageFlag ( IntPtr Socket, uint MailNo, int MessageFlag, int Command, int Flag ) : int
Imap4Close ( IntPtr Socket ) : int
Imap4CloseMailBox ( IntPtr Socket ) : int
Imap4ConnectPortNo ( string Host, int Port ) : IntPtr
Imap4ConnectSsl ( string Host, int Port, int Flag, string Name ) : IntPtr
Imap4CopyMail ( IntPtr Socket, uint MailNo, string MailBox, int Flag ) : int
Imap4CreateMailBox ( IntPtr Socket, string MailBox ) : int
Imap4DecodeHeaderField ( StringBuilder Destination, string Source, int Size ) : int
Imap4DeleteMail ( IntPtr Socket, uint MailNo, int Flag ) : int
Imap4DeleteMailBox ( IntPtr Socket, string MailBox ) : int
Imap4ExpungeMail ( IntPtr Socket ) : int
Imap4GetHeaderField ( StringBuilder Field, string Header, string Name, int Size ) : int
Imap4GetMail ( IntPtr Socket, uint MailNo, StringBuilder Subject, StringBuilder Date, StringBuilder From, StringBuilder Header, StringBuilder Body, string Path, StringBuilder FileName, int Flag ) : int
Imap4GetMailBoxList ( IntPtr Socket, string Refer, string MailBox, bool SubscribeFlag ) : int
Imap4GetMailBoxListStatus ( IntPtr Socket, int No, int &MailBoxFlag, StringBuilder Separate, StringBuilder MailBox, int Size ) : int
Imap4GetMailBoxStatus ( IntPtr Socket, string MailBox, int type, uint &Data ) : int
Imap4GetMailSize ( IntPtr Socket, uint MailNo, int Flag ) : int
Imap4GetMailStatus ( IntPtr Socket, uint MailNo, StringBuilder Subject, StringBuilder Date, StringBuilder From, StringBuilder Header, int &MessageFlag, int Flag ) : int
Imap4GetMimePart ( IntPtr Socket, uint MailNo, int PartNo, StringBuilder Body, int Flag ) : int
Imap4GetMimeStructure ( IntPtr Socket, uint MailNo, int Flag ) : int
Imap4GetMimeStructureStatus ( IntPtr Socket, int Type, int PartNo, int SubNo, StringBuilder Name, StringBuilder Value, int Size ) : int
Imap4GetNameSpace ( IntPtr Socket ) : int
Imap4GetNameSpaceStatus ( IntPtr Socket, int Type, StringBuilder Separate, StringBuilder Name, int Size ) : int
Imap4GetSearchMailResult ( IntPtr Socket, int No, uint &MailNo ) : int
Imap4GetUid ( IntPtr Socket, uint MailNo, uint &Uid ) : int
Imap4NoOperation ( IntPtr Socket ) : int
Imap4RenameMailBox ( IntPtr Socket, string OldMailBox, string NewMailBox ) : int
Imap4SaveMimePart ( IntPtr Socket, uint MailNo, int PartNo, string Path, StringBuilder FileName, int Flag ) : int
Imap4SearchMail ( IntPtr Socket, int Type, string Text, int Flag ) : int
Imap4SelectMailBox ( IntPtr Socket, string MailBox, bool ReadOnlyFlag ) : int
Imap4SubscribeMailBox ( IntPtr Socket, string MailBox ) : int
Imap4UnsubscribeMailBox ( IntPtr Socket, string MailBox ) : int
MakeDateString ( StringBuilder DateString, int Year, int Month, int Day, int Hour, int Minute, int Second, int Flag ) : int

Method Details

AddMessageFlag() public méthode

���[�����b�Z�[�W�t���O��t�����܂��B
�w�肵�����b�Z�[�W�t���O��t�����܂��B�w�肵�Ă��Ȃ��t���O�̏�Ԃ͂��̂܂܂ł��B

�t���O�t�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�ɕԐM�ς݃t���O��t�����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddMessageFlag(no, nMail.Imap4.MessageAnswerd); // �ԐM�ς݃t���O�t�� } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddMessageFlag(no, nMail.Imap4.MessageAnswerd) ' �ԐM�ς݃t���O�t�� Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AddMessageFlag ( uint no, int message_flag ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
message_flag int ���b�Z�[�W�t���O /// �ԐM�ς݃t���O /// �����}�[�N /// ���e�t���O /// �d�v���t���O /// �����t���O /// ���ǃt���O /// C# �� | �AVB.NET �ł� Or �ŕ����w��”\�ł��B ///
Résultat void

AddSearchAnd() public méthode

���[���̌��� AND (������)
AND �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̊��ǂ̃��[���� 2009/8/1 �ȍ~�ɓ����������[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchAnd(SearchSeen); imap.Search(SearchSince, MakeDateString(new DateTime(2009, 8, 1)); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchAnd(SearchSeen) imap.Search(SearchSince, MakeDateString(new DateTime(2009, 8, 1)) Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AddSearchAnd ( int type ) : void
type int ������� /// ��������̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �ԐM�ς� /// �ԐM�ς݂łȂ� /// �����}�[�N���� /// �����}�[�N�Ȃ� /// ���e�t���O���� /// ���e�t���O�Ȃ� /// �d�v���t���O���� /// �d�v���t���O�Ȃ� /// �����t���O���� /// �����t���O�Ȃ� /// ���ǃt���O���� /// ���ǃt���O�Ȃ� /// �����t���O���肩�Š��ǃt���O�Ȃ� /// �S�Ẵ��[�� /// ������� NOT (��L�̌�������Ɠ�����(C# �ł� | �AVB.NET �ł� Or)�w�肷��K�v������܂�) ///
Résultat void

AddSearchAnd() public méthode

���[���̌��� AND (������L)
AND �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̌�����"�e�X�g"���܂܂�A���o�l(From �t�B�[���h)�� [email protected] ���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchAnd(SearchSubject, "�e�X�g"); imap.Search(SearchFrom, "[email protected]"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchAnd(SearchSubject, "�e�X�g") imap.Search(SearchFrom, "[email protected]") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AddSearchAnd ( int type, string text ) : void
type int ������� /// ��������̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �w�肳�ꂽ�L�[���[�h���� /// �w�肳�ꂽ�L�[���[�h�Ȃ� /// From �w�b�_�Ɏw��̕����񂠂� /// To �w�b�_�Ɏw��̕����񂠂� /// CC �w�b�_�Ɏw��̕����񂠂� /// BCC �w�b�_�Ɏw��̕����񂠂� /// SUBJECT �w�b�_�Ɏw��̕����񂠂� /// DATE �w�b�_���w�肳�ꂽ���t�ȑO /// DATE �w�b�_���w�肳�ꂽ���t /// DATE �w�b�_���w�肳�ꂽ���t�ȍ~ /// �w�肳�ꂽ���t�ȑO�ɓ��� /// �w�肳�ꂽ���t�ɓ��� /// �w�肳�ꂽ���t�ȍ~�ɓ��� /// �w�肳�ꂽ�w�b�_�t�B�[���h�ɕ������܂� �����������"�w�b�_�t�B�[���h ������"�Ǝw�肵�Ă������� /// �{���ɕ������܂� /// �w�b�_����і{���ɕ������܂� /// �w��T�C�Y���傫�ȃ��[�� �T�C�Y�͕�����ɕϊ����Ă������� /// �w��T�C�Y��菬���ȃ��[�� �T�C�Y�͕�����ɕϊ����Ă������� /// �w�� UID �̃��[�� /// ����������𒼐ڎw�� /// ������� NOT (��L�̌�������Ɠ�����(C# �ł� | �AVB.NET �ł� Or)�w�肷��K�v������܂�) ///
text string ����������
Résultat void

AddSearchOr() public méthode

���[���̌��� OR (������)
OR �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̊��ǂ̃��[�����A�܂��͌�����"�e�X�g"���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchOr(SearchSeen); imap.Search(SearchSubject, "�e�X�g"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchOr(SearchSeen) imap.Search(SearchSubject, "�e�X�g") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AddSearchOr ( int type ) : void
type int ������� /// ��������̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �ԐM�ς� /// �ԐM�ς݂łȂ� /// �����}�[�N���� /// �����}�[�N�Ȃ� /// ���e�t���O���� /// ���e�t���O�Ȃ� /// �d�v���t���O���� /// �d�v���t���O�Ȃ� /// �����t���O���� /// �����t���O�Ȃ� /// ���ǃt���O���� /// ���ǃt���O�Ȃ� /// �����t���O���肩�Š��ǃt���O�Ȃ� /// �S�Ẵ��[�� /// ������� NOT (��L�̌�������Ɠ�����(C# �ł� | �AVB.NET �ł� Or)�w�肷��K�v������܂�) ///
Résultat void

AddSearchOr() public méthode

���[���̌��� OR (������L)
OR �Ō��������w�肵�܂��BSearch�Ō�������s���܂��B

���[���{�b�N�X("inbox")��̌�����"�e�X�g"���܂܂�邩�A�܂��͍��o�l(From �t�B�[���h)�� [email protected] ���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.AddSearchOr(SearchSubject, "�e�X�g"); imap.Search(SearchFrom, "[email protected]"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.AddSearchOr(SearchSubject, "�e�X�g") imap.Search(SearchFrom, "[email protected]") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AddSearchOr ( int type, string text ) : void
type int ������� /// ��������̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �w�肳�ꂽ�L�[���[�h���� /// �w�肳�ꂽ�L�[���[�h�Ȃ� /// From �w�b�_�Ɏw��̕����񂠂� /// To �w�b�_�Ɏw��̕����񂠂� /// CC �w�b�_�Ɏw��̕����񂠂� /// BCC �w�b�_�Ɏw��̕����񂠂� /// SUBJECT �w�b�_�Ɏw��̕����񂠂� /// DATE �w�b�_���w�肳�ꂽ���t�ȑO /// DATE �w�b�_���w�肳�ꂽ���t /// DATE �w�b�_���w�肳�ꂽ���t�ȍ~ /// �w�肳�ꂽ���t�ȑO�ɓ��� /// �w�肳�ꂽ���t�ɓ��� /// �w�肳�ꂽ���t�ȍ~�ɓ��� /// �w�肳�ꂽ�w�b�_�t�B�[���h�ɕ������܂� �����������"�w�b�_�t�B�[���h ������"�Ǝw�肵�Ă������� /// �{���ɕ������܂� /// �w�b�_����і{���ɕ������܂� /// �w��T�C�Y���傫�ȃ��[�� �T�C�Y�͕�����ɕϊ����Ă������� /// �w��T�C�Y��菬���ȃ��[�� �T�C�Y�͕�����ɕϊ����Ă������� /// �w�� UID �̃��[�� /// ����������𒼐ڎw�� /// ������� NOT (��L�̌�������Ɠ�����(C# �ł� | �AVB.NET �ł� Or)�w�肷��K�v������܂�) ///
text string ����������
Résultat void

AppendMail() public méthode

���[���{�b�N�X�Ƀ��[����A�b�v���[�h���܂��B

���M�σ��[���{�b�N�X("sent")�Ƀ��[������ǃt���O�t���ŃA�b�v���[�h����B subject �Ɍ����Afrom �ɍ��o�l�Ato �Ɉ���Abody �Ƀ��[���{���������Ă����̂Ƃ���B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { string header; try { imap.Connect(); imap.Authenticate("imap4_id", "password"); header = "Subject: " + subject + "\r\n"; header += "From: " + from + "\r\n"; header += "To: " + to + "\r\n"; imap.AppendMail("sent", header, body, MessageSeen); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Dim header As String Try imap.Connect() imap.Authenticate("imap4_id", "password") header = "Subject: " + subject + ControlChars.CrLf header += "From: " + from + ControlChars.CrLf header += "To: " + to + ControlChars.CrLf imap.AppendMail("sent", header, body, MessageSeen) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AppendMail ( string mailbox, string header, string body, int message_flag ) : void
mailbox string �A�b�v���[�h���郁�[���{�b�N�X
header string ���[���w�b�_ /// Date,Message-ID,Mime-Version,Content-Type,Content-Transfer-Encode �t�B�[���h /// �͎����I�ɕt������܂��BDate �t�B�[���h�ɂ͌��ݓ������ݒ肳��܂��B /// Date ����� Message-ID �t�B�[���h�͈��� header �ɋL�q������΂����炪�D�悳��܂��B ///
body string ���[���{��
message_flag int ���b�Z�[�W�t���O /// �ԐM�ς݃t���O /// �����}�[�N /// ���e�t���O /// �d�v���t���O /// �����t���O /// ���ǃt���O /// C# �� | �AVB.NET �ł� Or �ŕ����w��”\�ł��B ///
Résultat void

AppendMail() public méthode

���[���{�b�N�X�Ƀ��[����A�b�v���[�h���܂��B

���M�σ��[���{�b�N�X("sent")�Ƀ��[������ǃt���O�t���ŃA�b�v���[�h����B subject �Ɍ����Afrom �ɍ��o�l�Ato �Ɉ���Abody �Ƀ��[���{���Apath �ɓY�t�t�@�C���̃p�X���������Ă����̂Ƃ���B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { string header; try { imap.Connect(); imap.Authenticate("imap4_id", "password"); header = "Subject: " + subject + "\r\n"; header += "From: " + from + "\r\n"; header += "To: " + to + "\r\n"; imap.AppendMail("sent", header, body, MessageSeen, path); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Dim header As String Try imap.Connect() imap.Authenticate("imap4_id", "password") header = "Subject: " + subject + ControlChars.CrLf header += "From: " + from + ControlChars.CrLf header += "To: " + to + ControlChars.CrLf imap.AppendMail("sent", header, body, MessageSeen, path) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public AppendMail ( string mailbox, string header, string body, int message_flag, string path ) : void
mailbox string �A�b�v���[�h���郁�[���{�b�N�X
header string ���[���w�b�_ /// Date,Message-ID,Mime-Version,Content-Type,Content-Transfer-Encode �t�B�[���h /// �͎����I�ɕt������܂��BDate �t�B�[���h�ɂ͌��ݓ������ݒ肳��܂��B /// Date ����� Message-ID �t�B�[���h�͈��� header �ɋL�q������΂����炪�D�悳��܂��B ///
body string ���[���{��
message_flag int ���b�Z�[�W�t���O /// �ԐM�ς݃t���O /// �����}�[�N /// ���e�t���O /// �d�v���t���O /// �����t���O /// ���ǃt���O /// C# �� | �AVB.NET �ł� Or �ŕ����w��”\�ł��B ///
path string �Y�t�t�@�C����
Résultat void

Authenticate() public méthode

IMAP4 �T�[�o�F�؂�s���܂��B
ID �ƃp�X���[�h��w�肵�� IMAP4 �T�[�o�F�؂�s���܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// ID ������̓p�X���[�h�ɕ����񂪓����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Authenticate ( string id_str, string pass_str ) : void
id_str string IMAP4 ���[�U�[ ID
pass_str string IMAP4 �p�X���[�h
Résultat void

Authenticate() public méthode

IMAP4 �T�[�o�F�؂�s���܂��B
ID�A�p�X���[�h����єF�،`����w�肵�� IMAP4 �T�[�o�F�؂�s���܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// ID ������̓p�X���[�h�ɕ����񂪓����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Authenticate ( string id_str, string pass_str, int mode ) : void
id_str string IMAP4 ���[�U�[ ID
pass_str string IMAP4 �p�X���[�h
mode int �F�،`�� /// �F�،`���̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �� LOGIN ��g�p���܂��B /// �� PLAIN ��g�p���܂��B /// CRAM MD5 ��g�p���܂��B /// DIGEST MD5 ��g�p���܂��B /// C# �� | �AVB.NET �ł� Or �ŕ����w��”\�ł��B /// DIGEST MD5��CRAM MD5��PLAIN��LOGIN �̗D�揇�ʂŔF�؂���݂܂��B ///
Résultat void

Close() public méthode

IMAP4 �T�[�o�Ƃ̐ڑ���I�����܂��B
public Close ( ) : void
Résultat void

CloseMailBox() public méthode

���[���{�b�N�X�̑I���I�����܂��B

���[���{�b�N�X�̑I���I�����܂��B

���[���{�b�N�X�̑I��I�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public CloseMailBox ( ) : void
Résultat void

Connect() public méthode

IMAP4 �T�[�o�ɐڑ����܂��B
IMAP4 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// IMAP4 �T�[�o�[�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( ) : void
Résultat void

Connect() public méthode

IMAP4 �T�[�o�ɐڑ����܂��B
�|�[�g�ԍ���w�肵�� IMAP4 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// IMAP4 �T�[�o�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( int port_no ) : void
port_no int �|�[�g�ԍ�
Résultat void

Connect() public méthode

IMAP4 �T�[�o�ɐڑ����܂��B
�T�[�o����w�肵�� IMAP4 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// IMAP4 �T�[�o�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( string host_name ) : void
host_name string IMAP4 �T�[�o�[��
Résultat void

Connect() public méthode

IMAP4 �T�[�o�ɐڑ����܂��B
�T�[�o���ƃ|�[�g�ԍ���w�肵�� IMAP4 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// IMAP4 �T�[�o�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( string host_name, int port_no ) : void
host_name string IMAP4 �T�[�o��
port_no int �|�[�g�ԍ�
Résultat void

Copy() public méthode

���[����R�s�[���܂��B
���ݑI�����Ă��郁�[���{�b�N�X�̃��[����w��̃��[���{�b�N�X�ɃR�s�[���܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Copy ( uint no, string mailbox ) : void
no uint �R�s�[���郁�[���ԍ�(�� true �̏ꍇ UID)
mailbox string �R�s�[��̃��[���{�b�N�X��
Résultat void

CreateMailBox() public méthode

���[���{�b�N�X��쐬���܂��B
���[���{�b�N�X��쐬���܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public CreateMailBox ( string mailbox ) : void
mailbox string �쐬���郁�[���{�b�N�X��
Résultat void

DecodeHeaderField() public méthode

MIME �w�b�_�t�B�[���h�̕������f�R�[�h���܂�
public DecodeHeaderField ( string field ) : string
field string �t�B�[���h�̕�����
Résultat string

Delete() public méthode

���[���̍폜�}�[�N��t�����܂��B ���ۂ̍폜��Expunge���\�b�h��Ăяo�����ۂɍs���܂��B

���[���폜�}�[�N�t�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�ɍ폜�}�[�N��t�����A���ۂɍ폜���܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Delete(no); // �폜�}�[�N�t�� imap.Expunge(); // �폜���s MessageBox.Show(String.Format("���[���ԍ�:{0:d}��폜����", no)); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Delete(no) ' �폜�}�[�N�t�� imap.Expunge() ' �폜���s MessageBox.Show(String.Format("���[���ԍ�:{0:d}��폜����", no)) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Delete ( uint no ) : void
no uint �폜�}�[�N��t�����郁�[���ԍ�(�� true �̏ꍇ UID)
Résultat void

DeleteMailBox() public méthode

���[���{�b�N�X��폜���܂��B
���[���{�b�N�X��폜���܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public DeleteMailBox ( string mailbox ) : void
mailbox string �폜���郁�[���{�b�N�X��
Résultat void

DeleteMessageFlag() public méthode

���[�����b�Z�[�W�t���O��폜���܂��B
�w�肵�����b�Z�[�W�t���O��폜���܂��B�w�肵�Ă��Ȃ��t���O�̏�Ԃ͂��̂܂܂ł��B

���[�����b�Z�[�W�t���O�t�����s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)����폜�}�[�N�t���O��폜���܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.DeleteMessageFlag(no, nMail.Imap4.MessageDeleted); // �폜�}�[�N�t���O�폜 } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.DeleteMessageFlag(no, nMail.Imap4.MessageDeleted) ' �폜�}�[�N�t���O�폜 Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public DeleteMessageFlag ( uint no, int message_flag ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
message_flag int ���b�Z�[�W�t���O /// �ԐM�ς݃t���O /// �����}�[�N /// ���e�t���O /// �d�v���t���O /// �����t���O /// ���ǃt���O /// C# �� | �AVB.NET �ł� Or �ŕ����w��”\�ł��B ///
Résultat void

Dispose() public méthode

Imap4�ɂ���Ďg�p����Ă��邷�ׂẴ��\�[�X�������܂��B
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

Imap4�ɂ���Ďg�p����Ă��邷�ׂẴ��\�[�X�������܂��B
protected Dispose ( bool disposing ) : void
disposing bool /// �}�l�[�W���\�[�X�ƃA���}�l�[�W���\�[�X�̗�����������ꍇ��true�B /// �A���}�l�[�W���\�[�X������������ꍇ��false�B ///
Résultat void

Expunge() public méthode

�폜�}�[�N�̂‚��Ă��郁�[����폜���܂��B

�폜�}�[�N�̂‚��Ă��郁�[����폜���܂��B

���[���폜���s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Expunge ( ) : void
Résultat void

GetAttachmentFileStatus() public méthode

�Y�t�t�@�C���̑��݃`�F�b�N��s���܂��B
��������Ă��郁�[���ɂ‚��Ă͈�x��M��AAttachment �N���X�Ō������Ă��������B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B ///
public GetAttachmentFileStatus ( uint no ) : bool
no uint ���[���ԍ�(�� true �̏ꍇ UID)
Résultat bool

GetDecodeHeaderField() public méthode

���[���w�b�_����w��̃w�b�_�t�B�[���h�̓�e��擾���A MIME �w�b�_�t�B�[���h�̃f�R�[�h��s���ĕԂ��܂�
public GetDecodeHeaderField ( string field_name ) : string
field_name string �t�B�[���h��
Résultat string

GetDecodeHeaderField() public méthode

���[���w�b�_����w��̃w�b�_�t�B�[���h�̓�e��擾���A MIME �w�b�_�t�B�[���h�̃f�R�[�h��s���ĕԂ��܂�
public GetDecodeHeaderField ( string field_name, string header ) : string
field_name string �t�B�[���h��
header string �w�b�_
Résultat string

GetFileNameList() public méthode

�Y�t�t�@�C�����̔z���擾���܂��B
public GetFileNameList ( ) : string[]
Résultat string[]

GetHeaderField() public méthode

���[���w�b�_����w��̃t�B�[���h�̓�e��擾���܂��B
IMAP4 �T�[�o�Ƃ̐ڑ��Ƃ͖��֌W�Ɏg�p�ł��܂��B

�w�b�_�́AHeader�Őݒ肵�Ă����܂��B GetMail�Ŏ�M��������ɌĂяo�����ꍇ�A ��M�������[���̃w�b�_��g�p���܂��B

�擾�����t�B�[���h��e��Field�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ�:no)�� X-Mailer �w�b�_�t�B�[���h��擾����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetMail(no); MessageBox.Show("X-Mailer:" + imap.GetHeaderField("X-Mailer:")); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception e) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetMail(no) MessageBox.Show("X-Mailer:" + imap.GetHeaderField("X-Mailer:")) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetHeaderField ( string field_name ) : string
field_name string �t�B�[���h��
Résultat string

GetHeaderField() public méthode

���[���w�b�_����w��̃t�B�[���h�̓�e��擾���܂��B
public GetHeaderField ( string field_name, string header ) : string
field_name string �t�B�[���h��
header string �w�b�_
Résultat string

GetMail() public méthode

���[����擾���܂��B
no�p�����[�^�Ń��[����擾���������[���ԍ���w�肵�܂��B

�Y�t�t�@�C����ۑ��������ꍇ�APath�ɕۑ��������t�H���_��w�肵�Ă����܂��B

�g���@�\��g�p�������ꍇ�AFlag�Őݒ肵�Ă����܂��B

������Subject�Ŏ擾�ł��܂��B

���t�������DateString�Ŏ擾�ł��܂��B

���o�l��From�Ŏ擾�ł��܂��B

�w�b�_��Header�Ŏ擾�ł��܂��B

���[���T�C�Y��Size�Ŏ擾�ł��܂��B

�Y�t�t�@�C������FileName�Ŏ擾�ł��܂��B

/// �ڑ���Ԃł͂���܂���B���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �Ŏw�肵���t�H���_�����݂��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMail ( uint no ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
Résultat void

GetMailBoxList() public méthode

���[���{�b�N�X�̈ꗗ��擾���܂��B
���[���{�b�N�X�̈ꗗ��擾���܂��B�ꗗ��GetMailBoxList �Ŏ擾�ł��܂��B

�S�Ẵ��[���{�b�N�X�̈ꗗ��\�����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); // ���[���{�b�N�X�ꗗ��擾 imap.GetMailBoxList("", "*"); nMail.Imap4.MailBoxStatus [] list = imap4.GetMailBoxStatusList() foreach(nMail.Imap4.MailBoxStatus mailbox in list) { MessageBox.Show(string.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)); } } catch(nMail.nMailException nex) { MessageBox.Show(string.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(string.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") ' ���[���{�b�N�X�ꗗ��擾 imap.GetMailBoxList("", "*") Dim list As nMail.Imap4.MailBoxStatus() = imap4.GetMailBoxList() For Each mailbox As nMail.Imap4.MailBoxStatus In list MessageBox.Show(String.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)) Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxList ( string refer, string mailbox ) : void
refer string �K�w�ʒu�ł��B
mailbox string ���C���h�J�[�h�ł��B"*" �őS�āA"%" �œ����K�w�̃��[���{�b�N�X��������܂��B
Résultat void

GetMailBoxListSubscribe() public méthode

�w�Ǎς݃��[���{�b�N�X�̈ꗗ��擾���܂��B
�w�Ǎς݃��[���{�b�N�X�̈ꗗ��擾���܂��B�ꗗ��GetMailBoxStatusList �Ŏ擾�ł��܂��B�B

�S�Ă̍w�Ǎς݃��[���{�b�N�X�̈ꗗ��\�����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); // �w�Ǎς݃��[���{�b�N�X�ꗗ��擾 imap.GetMailBoxListSubscribe("", "*"); nMail.Imap4.MailBoxStatus [] list = imap4.GetMailBoxStatusList() foreach(nMail.Imap4.MailBoxStatus mailbox in list) { MessageBox.Show(string.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)); } } catch(nMail.nMailException nex) { MessageBox.Show(string.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(string.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") ' �w�Ǎς݃��[���{�b�N�X�ꗗ��擾 imap.GetMailBoxListSubscribe("", "*") Dim list As nMail.Imap4.MailBoxStatus() = imap4.GetMailBoxList() For Each mailbox As nMail.Imap4.MailBoxStatus In list MessageBox.Show(String.Format("���[���{�b�N�X��:{0:s} ��؂蕶��:{1:c} �t���O:{2:d}", mailbox.Name, mailbox.Separate, mailbox.Flag)) Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxListSubscribe ( string refer, string mailbox ) : void
refer string �K�w�ʒu�ł��B
mailbox string ���C���h�J�[�h�ł��B"*" �őS�āA"%" �œ����K�w�̃��[���{�b�N�X��������܂��B
Résultat void

GetMailBoxMessageCount() public méthode

���[���{�b�N�X�̃��b�Z�[�W������擾���܂��B
mailbox�p�����[�^�Ń��b�Z�[�W������擾���������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxMessageCount ( string mailbox ) : int
mailbox string ���b�Z�[�W������擾���������[���{�b�N�X���ł��B
Résultat int

GetMailBoxNextUid() public méthode

���[���{�b�N�X�̐V�������b�Z�[�W�� UID ��擾���܂��B
mailbox�p�����[�^�ŐV�������b�Z�[�W�� UID �l��擾���������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxNextUid ( string mailbox ) : uint
mailbox string �V�������b�Z�[�W�� UID �l��擾���������[���{�b�N�X���ł��B
Résultat uint

GetMailBoxRecentCount() public méthode

���[���{�b�N�X�̐V�����b�Z�[�W����擾���܂��B
mailbox�p�����[�^�ŐV�����b�Z�[�W����擾���������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxRecentCount ( string mailbox ) : int
mailbox string �V�����b�Z�[�W����擾���������[���{�b�N�X���ł��B
Résultat int

GetMailBoxStatusList() public méthode

���[���{�b�N�X���̔z���擾���܂��B
public GetMailBoxStatusList ( ) : MailBoxStatus[]
Résultat MailBoxStatus[]

GetMailBoxUidValidity() public méthode

���[���{�b�N�X�� UID Validity �l��擾���܂��B
mailbox�p�����[�^�� UID Validity �l��擾���������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxUidValidity ( string mailbox ) : uint
mailbox string UID Validity �l��擾���������[���{�b�N�X���ł��B
Résultat uint

GetMailBoxUnSeen() public méthode

���[���{�b�N�X�̖��ǃ��b�Z�[�W����擾���܂��B
mailbox�p�����[�^�Ŗ��ǃ��b�Z�[�W����擾���������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMailBoxUnSeen ( string mailbox ) : int
mailbox string ���ǃ��b�Z�[�W����擾���������[���{�b�N�X���ł��B
Résultat int

GetMimePart() public méthode

MIME �p�[�g��擾

���ǃt���O�𗧂ĂȂ��ꍇ�A�f�R�[�h���Ȃ��ꍇ�́AMimeFlag�Őݒ肵�Ă����܂��B

�擾�����p�[�g�{����Body�Ŏ擾�ł��܂��B

�T���v���� GetMimeStructure��Q�Ƃ��Ă��������B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMimePart ( uint no, int part_no ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
part_no int MIME �p�[�g�ԍ�
Résultat void

GetMimePartHeader() public méthode

MIME �p�[�g�w�b�_��擾

���ǃt���O�𗧂ĂȂ��ꍇ�A�f�R�[�h���Ȃ��ꍇ�́AMimeFlag�Őݒ肵�Ă����܂��B

�擾�����p�[�g�w�b�_��Header�Ŏ擾�ł��܂��B

�T���v���� GetMimeStructure��Q�Ƃ��Ă��������B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMimePartHeader ( uint no, int part_no ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
part_no int MIME �p�[�g�ԍ�
Résultat void

GetMimeStructure() public méthode

MIME �\����擾���܂��B

MIME �\����GetMimeStructureStatusList�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�� MIME �\����擾���A�e�L�X�g�ł���Ζ{����\���A�Y�t�t�@�C���ł���� z:\temp �ɕۑ����܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); // MIME �\����擾 imap.GetMimeStructure(no); nMail.Imap4.MimeStructureStatus [] list = imap4.GetMimeStructureStatusList() foreach(nMail.Imap4.MimeStructureStatus mime in list) { // �e�L�X�g�ł���Ζ{����擾���ĕ\�� if(string.Compare(mime.Type, "text", true) == 0 && string.Compare(mime.SubType, "plain", true) == 0) { // �{���擾 imap.GetMimePart(no, mime.PartNo); MessageBox.Show(imap.Body); } else if(string.Compare(mime.Type, "multipart", true) != 0) { // �Y�t�t�@�C����ۑ� imap.SaveMimePart(no, mime.PartNo, @"z:\temp\" + mime.FileName); } } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") ' MIME �\����擾 imap.GetMimeStructure(no) Dim list As nMail.Imap4.MimeStructureStatus() = imap4.GetMimeStructureList() For Each mime As nMail.Imap4.MimeStructureStatus In list ' �e�L�X�g�ł���Ζ{����擾���ĕ\�� If (String.Compare(mime.Type, "text", True) = 0) And (String.Compare(mime.SubType, "plain", True) = 0) Then ' �{���擾 imap.GetMimePart(no, mime.PartNo) MessageBox.Show(imap.Body) Else If String.Compare(mime.Type, "multipart", true) <> 0 Then ' �Y�t�t�@�C����ۑ� imap.SaveMimePart(no, mime.PartNo, "z:\temp\" + mime.FileName) End If Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMimeStructure ( uint no ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
Résultat void

GetMimeStructureStatusList() public méthode

MIME �\���̔z���擾���܂��B
public GetMimeStructureStatusList ( ) : MimeStructureStatus[]
Résultat MimeStructureStatus[]

GetNameSpace() public méthode

���O��Ԃ�擾���܂��B

���O��Ԃ�擾���A�\������B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { string header; try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.GetNameSpace(); nMail.Imap4.NameSpaceStatus [] list = imap.GetNameSpacePersonalStatusList() foreach(nMail.Imap4.NameSpaceStatus item in list) { MessageBox.Show(string.Format("�l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)); } list = imap.GetNameSpaceOtherStatusList() foreach(nMail.Imap4.NameSpaceStatus item in list) { MessageBox.Show(string.Format("���l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)); } list = imap.GetNameSpaceSharedStatusList() foreach(nMail.Imap4.NameSpaceStatus item in list) { MessageBox.Show(string.Format("���L���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Dim header As String Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.GetNameSpace() Dim list As nMail.Imap4.NameSpaceStatus() = imap.GetNameSpacePersonalStatusList() For Each item As nMail.Imap4.NameSpaceStatus In list MessageBox.Show(String.Format("�l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)) Next list = imap.GetNameSpaceOtherStatusList() For Each item As nMail.Imap4.NameSpaceStatus In list MessageBox.Show(String.Format("���l���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)) Next list = imap.GetNameSpaceSharedStatusList() For Each item As nMail.Imap4.NameSpaceStatus In list MessageBox.Show(String.Format("���L���O���:{0:s} ��؂蕶��:{1:c}", item.Name, item.Separate)) Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetNameSpace ( ) : void
Résultat void

GetNameSpaceOtherStatusList() public méthode

���l���O��Ԃ̔z���擾���܂��B

GetNameSpace���s��ɌĂяo���K�v������܂��B

public GetNameSpaceOtherStatusList ( ) : NameSpaceStatus[]
Résultat NameSpaceStatus[]

GetNameSpacePersonalStatusList() public méthode

�l���O��Ԃ̔z���擾���܂��B

GetNameSpace���s��ɌĂяo���K�v������܂��B

public GetNameSpacePersonalStatusList ( ) : NameSpaceStatus[]
Résultat NameSpaceStatus[]

GetNameSpaceSharedStatusList() public méthode

���L���O��Ԃ̔z���擾���܂��B

GetNameSpace���s��ɌĂяo���K�v������܂��B

public GetNameSpaceSharedStatusList ( ) : NameSpaceStatus[]
Résultat NameSpaceStatus[]

GetSearchMailResultList() public méthode

�������ʂ̔z���擾���܂��B
public GetSearchMailResultList ( ) : uint[]
Résultat uint[]

GetSize() public méthode

���[���̃T�C�Y��擾���܂��B
no�p�����[�^�Ń��[���T�C�Y��擾���������[���ԍ���w�肵�܂��B

���[���{�b�N�X("inbox")��̃��[���ԍ�(�ϐ���:no)�̃��[���T�C�Y��擾����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetSize(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, imap.Size)); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, imap.Size)) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetSize ( uint no ) : int
no uint ���[���ԍ�(�� true �̏ꍇ UID)
Résultat int

GetStatus() public méthode

���[���̃X�e�[�^�X��擾���܂��B
no�p�����[�^�ŃX�e�[�^�X��擾���������[���ԍ���w�肵�܂��B

������Subject�Ŏ擾�ł��܂��B

���t�������DateString�Ŏ擾�ł��܂��B

���o�l��From�Ŏ擾�ł��܂��B

�w�b�_��Header�Ŏ擾�ł��܂��B

���b�Z�[�W�t���O��MessageFlag�Ŏ擾�ł��܂��B

�X�e�[�^�X�擾���s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetStatus ( uint no ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
Résultat void

GetUid() public méthode

���[���� UID ��擾���܂��B

�擾���� UID �͕Ԓl������� Uid�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)�� UID ��擾����B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.GetUid(no); MessageBox.Show("Uid=" + imap.Uid.ToString()); } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.GetUid(no) MessageBox.Show("Uid=" + imap.Uid.ToString()) Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetUid ( uint no ) : uint
no uint ���[���ԍ�
Résultat uint

Imap4() public méthode

Imap4�N���X�̐V�K�C���X�^���X����������܂��B
public Imap4 ( ) : System
Résultat System

Imap4() public méthode

Imap4�N���X�̐V�K�C���X�^���X����������܂��B
public Imap4 ( string host_name ) : System
host_name string IMAP4 �T�[�o�[��
Résultat System

Init() protected méthode

�����������ł��B
protected Init ( ) : void
Résultat void

IsConnected() public méthode

�T�[�o�ɐڑ��������肷��
public IsConnected ( ) : bool
Résultat bool

MakeAppendDateString() public méthode

AppenMail�p�����w�蕶�����쐬���܂��B
�����w�蕶�����쐬���܂��B

AppendMail�p ��: "09-Jul-2009 15:10:30"

�����̂Ƃ��� AppendMail �ŃA�b�v���[�h����ۂ̃T�[�o������I�Ɏ��“����w��ɂ�

�@Imap4 �N���X�̃��\�b�h�ł͑Ή����Ă��܂���B

�@Date �w�b�_�t�B�[���h�̒l�� MakeFieldDateString �ō쐬���ĕt�����邱�Ƃ��ł��܂��B

public MakeAppendDateString ( DateTime tm ) : string
tm DateTime
Résultat string

MakeFieldDateString() public méthode

Date �w�b�_�t�B�[���h�p�����w�蕶�����쐬���܂��B
�����w�蕶�����쐬���܂��B

Date �w�b�_�t�B�[���h�p ��: "Thu, 9 Jul 2009 15:10:30 +09:00"

AppendMail �Ŏw��̓����� Date �w�b�_�t�B�[���h��t���������ꍇ�Ɏg�p���܂��B

public MakeFieldDateString ( DateTime tm ) : string
tm DateTime
Résultat string

MakeSearchDateString() public méthode

�����p���t�w�蕶�����쐬���܂��B
���t�w�蕶�����쐬���܂��B

�����p ��: "09-Jul-2009"

���[���{�b�N�X("inbox")��� 2009/8/1 �ɓ����������[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Search(SearchOn, MakeSearchDateString(new DateTime(2009, 8, 1)); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Search(SearchOn, MakeSearchDateString(new DateTime(2009, 8, 1)) Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

public MakeSearchDateString ( DateTime tm ) : string
tm DateTime
Résultat string

NoOperation() public méthode

�Ȃɂ���s���܂���
�T�[�o�Ƃ̐ڑ��^�C���A�E�g�h�~���Ɏg�p���܂��B
public NoOperation ( ) : void
Résultat void

RenameMailBox() public méthode

���[���{�b�N�X����ύX���܂��B
���[���{�b�N�X����ύX���܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public RenameMailBox ( string old_name, string new_name ) : void
old_name string �ύX����O�̃��[���{�b�N�X��
new_name string �ύX��̃��[���{�b�N�X��
Résultat void

ReplaceMessageFlag() public méthode

���[�����b�Z�[�W�t���O��u�������܂��B
�w�肵�����b�Z�[�W�t���O�Œu�������܂��B

���[�����b�Z�[�W�t���O�u���������s�̏ꍇ�̃G���[�ԍ���nMailException.ErrorCode�Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̎w��̃��[���ԍ�(�ϐ���:no)����ǂ���яd�v���b�Z�[�W�t���O���t���Ă����ԂƂ��܂��B using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.ReplaceMessageFlag(no, nMail.Imap4.MessageFlagged | nMail.Imap4.MessageSeen); // ���ǂ���яd�v���t���O } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.ReplaceMessageFlag(no, nMail.Imap4.MessageFlagged Or nMail.Imap4.MessageSeen) ' ���Njy�яd�v���t���O Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public ReplaceMessageFlag ( uint no, int message_flag ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
message_flag int ���b�Z�[�W�t���O /// �ԐM�ς݃t���O /// �����}�[�N /// ���e�t���O /// �d�v���t���O /// �����t���O /// ���ǃt���O /// C# �� | �AVB.NET �ł� Or �ŕ����w��”\�ł��B ///
Résultat void

SaveMimePart() public méthode

MIME �p�[�g��ۑ�

���ǃt���O�𗧂ĂȂ��ꍇ�A�f�R�[�h���Ȃ��ꍇ�́AMimeFlag�Őݒ肵�Ă����܂��B

�ۑ������t�@�C������FileName�Ŏ擾�ł��܂��B

�T���v���� GetMimeStructure��Q�Ƃ��Ă��������B

Content-Type �̃^�C�v�� "multipart" �� MIME �p�[�g��w�肵���ꍇ�A�G���[�ɂȂ�܂��̂ł����Ӊ������B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public SaveMimePart ( uint no, int part_no, string path ) : void
no uint ���[���ԍ�(�� true �̏ꍇ UID)
part_no int MIME �p�[�g�ԍ�
path string �ۑ�����t�@�C����
Résultat void

Search() public méthode

���[���̌������s(������)
�������ʂ� GetSearchMailResultList �Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̐V�K�̃��[��(�����t���O�L�肩�Š��ǃt���O�Ȃ�)��������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Search(SearchNew); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Search(SearchNew) Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Search ( int type ) : void
type int ������� /// ��������̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �ԐM�ς� /// �ԐM�ς݂łȂ� /// �����}�[�N���� /// �����}�[�N�Ȃ� /// ���e�t���O���� /// ���e�t���O�Ȃ� /// �d�v���t���O���� /// �d�v���t���O�Ȃ� /// �����t���O���� /// �����t���O�Ȃ� /// ���ǃt���O���� /// ���ǃt���O�Ȃ� /// �����t���O���肩�Š��ǃt���O�Ȃ� /// �S�Ẵ��[�� /// ������� NOT (��L�̌�������Ɠ�����(C# �ł� | �AVB.NET �ł� Or)�w�肷��K�v������܂�) ///
Résultat void

Search() public méthode

���[���̌������s(������L)
�������ʂ� GetSearchMailResultList �Ŏ擾�ł��܂��B

���[���{�b�N�X("inbox")��̍��o�l(From �t�B�[���h)�� [email protected] ���܂܂�郁�[����������� using(nMail.Imap4 imap = new nMail.Imap4("mail.example.com")) { try { imap.Connect(); imap.Authenticate("imap4_id", "password"); imap.SelectMailBox("inbox"); imap.Search(SearchFrom, "[email protected]"); uint [] list = imap4.GetSearchMailResultList() foreach(uint no in list) { MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); } } catch(nMail.nMailException nex) { MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)); } catch(Exception ex) { MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)); } } ' VB.NET 2005 �ȍ~�̏ꍇ�AC# �Ɠ��l�� using ���g�p�ł��܂��B Dim imap As nMail.Imap4 = New nMail.Imap4("mail.example.com") Try imap.Connect() imap.Authenticate("imap4_id", "password") imap.SelectMailBox("inbox") imap.Search(SearchFrom, "[email protected]") Dim list As Integer() = imap4.GetSearchMailResultList() For Each no As Integer In list MessageBox.Show(String.Format("�������ʃ��[���ԍ� {0}", no)); Next Catch nex As nMail.nMailException MessageBox.Show(String.Format("�G���[ �ԍ�:{0:d} ���b�Z�[�W:{1:s}", nex.ErrorCode, nex.Message)) Catch ex As Exception MessageBox.Show(String.Format("�G���[ ���b�Z�[�W:{0:s}", ex.Message)) Finally imap.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Search ( int type, string text ) : void
type int ������� /// ��������̐ݒ�”\�Ȓl�͉��L�̒ʂ�ł��B /// �w�肳�ꂽ�L�[���[�h���� /// �w�肳�ꂽ�L�[���[�h�Ȃ� /// From �w�b�_�Ɏw��̕����񂠂� /// To �w�b�_�Ɏw��̕����񂠂� /// CC �w�b�_�Ɏw��̕����񂠂� /// BCC �w�b�_�Ɏw��̕����񂠂� /// SUBJECT �w�b�_�Ɏw��̕����񂠂� /// DATE �w�b�_���w�肳�ꂽ���t�ȑO /// DATE �w�b�_���w�肳�ꂽ���t /// DATE �w�b�_���w�肳�ꂽ���t�ȍ~ /// �w�肳�ꂽ���t�ȑO�ɓ��� /// �w�肳�ꂽ���t�ɓ��� /// �w�肳�ꂽ���t�ȍ~�ɓ��� /// �w�肳�ꂽ�w�b�_�t�B�[���h�ɕ������܂� �����������"�w�b�_�t�B�[���h ������"�Ǝw�肵�Ă������� /// �{���ɕ������܂� /// �w�b�_����і{���ɕ������܂� /// �w��T�C�Y���傫�ȃ��[�� �T�C�Y�͕�����ɕϊ����Ă������� /// �w��T�C�Y��菬���ȃ��[�� �T�C�Y�͕�����ɕϊ����Ă������� /// �w�� UID �̃��[�� /// ����������𒼐ڎw�� /// ������� NOT (��L�̌�������Ɠ�����(C# �ł� | �AVB.NET �ł� Or)�w�肷��K�v������܂�) ///
text string ����������
Résultat void

SelectMailBox() public méthode

���[���{�b�N�X��I����܂��B
mailbox�p�����[�^�őI����������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public SelectMailBox ( string mailbox ) : void
mailbox string �I����郁�[���{�b�N�X���ł��B
Résultat void

SelectMailBoxReadOnly() public méthode

���[���{�b�N�X��ǂݏo����p�őI����܂��B
mailbox�p�����[�^�œǂݏo����p�őI����������[���{�b�N�X����w�肵�܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public SelectMailBoxReadOnly ( string mailbox ) : void
mailbox string �I����郁�[���{�b�N�X���ł��B
Résultat void

SetHeaderSize() protected méthode

�w�b�_�i�[�p�o�b�t�@�̃T�C�Y����肵�܂��B
protected SetHeaderSize ( ) : void
Résultat void

SubscribeMailBox() public méthode

���[���{�b�N�X��w�ǂ��܂��B
���[���{�b�N�X��w�ǂ��܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public SubscribeMailBox ( string mailbox ) : void
mailbox string �w�ǂ��郁�[���{�b�N�X��
Résultat void

UnsubscribeMailBox() public méthode

���[���{�b�N�X�̍w�ǂ������܂��B
���[���{�b�N�X�̍w�ǂ������܂��B
/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public UnsubscribeMailBox ( string mailbox ) : void
mailbox string �w�lj�����郁�[���{�b�N�X��
Résultat void

Property Details

_body protected_oe property

�{���i�[�o�b�t�@�ł��B
protected StringBuilder _body
Résultat StringBuilder

_body_size protected_oe property

�{���̃T�C�Y�ł��B
protected int _body_size
Résultat int

_cert_name protected_oe property

SSL �N���C�A���g�ؖ������ł��B
protected string _cert_name
Résultat string

_count protected_oe property

���[�����ł��B
protected int _count
Résultat int

_date protected_oe property

���t������ۑ��o�b�t�@�ł��B
protected StringBuilder _date
Résultat StringBuilder

_err protected_oe property

�G���[�ԍ��ł��B
protected int _err
Résultat int

_field protected_oe property

�w�b�_�t�B�[���h��e�i�[�o�b�t�@�ł��B
protected StringBuilder _field
Résultat StringBuilder

_field_name protected_oe property

�w�b�_�t�B�[���h���ł��B
protected string _field_name
Résultat string

_filename protected_oe property

�Y�t�t�@�C�����i�[�o�b�t�@�ł��B
protected StringBuilder _filename
Résultat StringBuilder

_filename_list protected_oe property

�Y�t�t�@�C�����̃��X�g�ł��B
protected string[] _filename_list
Résultat string[]

_flag protected_oe property

���[����M���̐ݒ�p�t���O�ł��B
protected int _flag
Résultat int

_from protected_oe property

���o�l�i�[�o�b�t�@�ł��B
protected StringBuilder _from
Résultat StringBuilder

_header protected_oe property

�w�b�_�i�[�o�b�t�@�ł��B
protected StringBuilder _header
Résultat StringBuilder

_header_size protected_oe property

�w�b�_�[�T�C�Y�ł��B
protected int _header_size
Résultat int

_host protected_oe property

IMAP4 �T�[�o���ł��B
protected string _host
Résultat string

_html_file protected_oe property

text/html �p�[�g��ۑ������t�@�C���̖��O�ł��B
protected StringBuilder _html_file
Résultat StringBuilder

_id protected_oe property

IMAP4 ���[�U�[���ł��B
protected string _id
Résultat string

_mailbox protected_oe property

���[���{�b�N�X���ł��B
protected string _mailbox
Résultat string

_mailbox_list protected_oe property

���[���{�b�N�X��񃊃X�g�ł��B
GetMailBoxList�������GetMailBoxListSubscribe���s��Ɍ��ʂ��i�[����܂��B
protected MailBoxStatus[] _mailbox_list
Résultat MailBoxStatus[]

_message_flag protected_oe property

���[�����b�Z�[�W�̃t���O�ł��B
protected int _message_flag
Résultat int

_mime_flag protected_oe property

MIME �p�[�g�擾������͕ۑ��̍ۂ̐ݒ�t���O�ł��B
protected int _mime_flag
Résultat int

_mime_list protected_oe property

MIME �\����񃊃X�g�ł��B
GetMimeStructure���s��Ɍ��ʂ��i�[����܂��B
protected MimeStructureStatus[] _mime_list
Résultat MimeStructureStatus[]

_mode protected_oe property

IMAP4 �F�،`��
protected int _mode
Résultat int

_namespace_list protected_oe property

���O��ԏ�񃊃X�g�ł��B
GetNameSpace���s��Ɍ��ʂ��i�[����܂��B
protected NameSpaceStatus[][] _namespace_list
Résultat NameSpaceStatus[][]

_password protected_oe property

IMAP4 �p�X���[�h�ł��B
protected string _password
Résultat string

_path protected_oe property

�Y�t�t�@�C���ۑ��p�̃p�X�ł��B
protected string _path
Résultat string

_port protected_oe property

IMAP4 �|�[�g�ԍ��ł��B
protected int _port
Résultat int

_rfc822_file protected_oe property

message/rfc822 �p�[�g��ۑ������t�@�C���̖��O�ł��B
protected StringBuilder _rfc822_file
Résultat StringBuilder

_search_first_flag protected_oe property

�ŏ��̌������ǂ����̃t���O�ł��B
protected bool _search_first_flag
Résultat bool

_search_list protected_oe property

�������ʂ̃��X�g�ł��B
Search���s��Ɍ��ʂ��i�[����܂��B
protected uint[] _search_list
Résultat uint[]

_size protected_oe property

���[���T�C�Y�ł��B
protected int _size
Résultat int

_socket protected_oe property

�\�P�b�g�n���h���ł��B
protected IntPtr _socket
Résultat IntPtr

_ssl protected_oe property

SSL �ݒ�t���O�ł��B
protected int _ssl
Résultat int

_subject protected_oe property

�����i�[�o�b�t�@�ł��B
protected StringBuilder _subject
Résultat StringBuilder

_uid protected_oe property

UID �ł��B
protected uint _uid
Résultat uint

_useuid protected_oe property

���[����w�肷��ۂ� UID ��g�p���܂��B
protected int _useuid
Résultat int

_useuid_flag protected_oe property

���[����w�肷��ۂ� UID ��g�p���܂��B
protected bool _useuid_flag
Résultat bool