C# Class nMail.Pop3

POP3���[����M�N���X

�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.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetMail(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, pop.Subject, pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, pop.Subject, pop.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 pop.Dispose() End Try

SSL Version 3 ��g�p���A�w��̃��[���ԍ�(�ϐ���:no)��擾���A�����Ɩ{����\������B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.SSL = nMail.Pop3.SSL3; pop.Connect(nMail.Pop3.StandardSslPortNo); // over SSL/TLS �̃|�[�g�ԍ���w�肵�Đڑ� pop.Authenticate("pop3_id", "password"); pop.GetMail(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, pop.Subject, pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.SSL = nMail.Pop3.SSL3 pop.Connect(nMail.Pop3.StandardSslPortNo) ' over SSL/TLS �̃|�[�g�ԍ���w�肵�Đڑ� pop.Authenticate("pop3_id", "password") pop.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, pop.Subject, pop.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 pop.Dispose() End Try

�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.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.Path = @"z:\temp"; pop.GetMail(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, pop.Subject, pop.Body)); string [] file_list = pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.Path = "z:\temp" pop.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, pop.Subject, pop.Body)) Dim file_list As String() = pop.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 pop.Dispose() End Try

�ꎞ�x�~�@�\��g���Ďw��̃��[���ԍ�(�ϐ���:no)��擾���A�����Ɩ{����\������B�Y�t�t�@�C���� z:\temp �ɕۑ�����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); // ���������̋x�~�񐔂𓾂� int count = pop.GetSize(no) / (nMail.Options.SuspendSize * 1024) + 1; pop.Path = @"z:\temp"; pop.GetMail(no); pop.Flag = nMail.Pop3.SuspendAttachmentFile; pop.GetMail(no); pop.Flag = nMail.Pop3.SuspendNext; while(pop.ErrorCode == nMail.Pop3.ErrorSuspendAttachmentFile) { pop.GetMail(no); // �v���O���X�o�[��i�߂铙�̏��� Application.DoEvents(); } MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}\r\n{2:s}", no, pop.Subject, pop.Body)); string [] file_list = pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try Dim count As Integer pop.Connect() pop.Authenticate("pop3_id", "password") ' ���������̋x�~�񐔂𓾂� count = pop.GetSize(no) \ (nMail.Options.SuspendSize * 1024) + 1 pop.Path = "z:\temp" pop.Flag = nMail.Pop3.SuspendAttachmentFile pop.GetMail(no) pop.Flag = nMail.Pop3.SuspendNext Do While pop.ErrorCode = nMail.Pop3.ErrorSuspendAttachmentFile pop.GetMail(no) ' �v���O���X�o�[��i�߂铙�̏��� Application.DoEvents() Loop MessageBox.Show(String.Format("���[���ԍ�:{0:d} ����:{1:s}" + ControlChars.CrLf + "{2:s}", no, pop.Subject, pop.Body)) Dim file_list As String() = pop.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 pop.Dispose() End Try

Inheritance: IDisposable
Mostra file Open project: hijirichan/AkaneMail Class Usage Examples

Protected Properties

Property Type Description
_apop bool
_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
_part_id StringBuilder
_part_no int
_password string
_path string
_port int
_rfc822_file StringBuilder
_size int
_socket System.IntPtr
_ssl int
_subject StringBuilder
_temp byte[]
_uidl StringBuilder

Public Methods

Method Description
Authenticate ( string id_str, string pass_str ) : void

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

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

Authenticate ( string id_str, string pass_str, bool apop_flag ) : void

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

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

Close ( ) : void

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

Connect ( ) : void

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

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

Connect ( int port_no ) : void

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

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

Connect ( string host_name ) : void

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

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

Connect ( string host_name, int port_no ) : void

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

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

DecodeHeaderField ( string field ) : string

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

Delete ( int no ) : void

���[����폜���܂��B

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

�w��̃��[���ԍ�(�ϐ���:no)��폜����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.Delete(no); 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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.Delete(no) 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 pop.Dispose() End Try

Dispose ( ) : void

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

GetAttachmentFileStatus ( int no ) : bool

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

�Y�t�t�@�C���̕�������PartNo�Ŏ擾�ł��܂��B

NoAttachmentFile�̏ꍇ�Y�t�t�@�C���͂���܂���B

AttachmentFile�̏ꍇ��������Ă��Ȃ��Y�t�t�@�C���t�����[���ł��B

1 �ȏ�̏ꍇ��������Ă���Y�t�t�@�C���ŕԂ�l�̓p�[�g�ԍ���\���܂��B

1 �̏ꍇ�́AFlag��PartialAttachmentFile ��ݒ肵�� GetMail��Ăяo���ƓY�t�t�@�C����������ĕۑ��”\�ł��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

POP3 �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

�w��̃��[���ԍ�(�ϐ�:no)�� X-Mailer �w�b�_�t�B�[���h��擾����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetMail(no); MessageBox.Show("X-Mailer:" + pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetMail(no) MessageBox.Show("X-Mailer:" + pop.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 pop.Dispose() End Try

GetHeaderField ( string field_name, string header ) : string

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

GetMail ( int 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

GetSize ( int no ) : int

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

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

���[���ԍ�(�ϐ���:no)�̃��[���T�C�Y��擾����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetSize(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, pop.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 pop.Dispose() End Try

GetStatus ( int 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

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

GetUidl ( int no ) : void

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

�擾���� UIDL ��Uidl�Ŏ擾�ł��܂��B

no��UidlAll��w�肷��ƁA POP3 �T�[�o��ɂ��邷�ׂẴ��[���� UIDL ��擾���܂��B

�w��̃��[���ԍ�(�ϐ���:no)�� UIDL ��擾����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetUidl(no); MessageBox.Show("Uidl=" + pop.Uidl); } 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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetUidl(no) MessageBox.Show("Uidl=" + pop.Uidl) 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 pop.Dispose() End Try

Pop3 ( ) : System

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

Pop3 ( string host_name ) : System

Pop3�N���X�̐V�K�C���X�^���X����������܂��B POP3 �T�[�o�[��

Protected Methods

Method Description
Dispose ( bool disposing ) : void

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

Init ( ) : void

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

SetHeaderSize ( ) : void

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

Private Methods

Method Description
Pop3Authenticate ( IntPtr Socket, string Id, string Pass, bool APopFlag ) : int
Pop3Close ( IntPtr Socket ) : int
Pop3ConnectPortNo ( string Host, int Port ) : IntPtr
Pop3ConnectSsl ( string Host, int Port, int Flag, string Name ) : IntPtr
Pop3DecodeHeaderField ( StringBuilder Destination, string Source, int Size ) : int
Pop3DeleteMail ( IntPtr Socket, int No ) : int
Pop3GetAttachmentFileStatus ( IntPtr Socket, int No, StringBuilder Id, int Max ) : int
Pop3GetHeaderField ( StringBuilder Field, string Header, string Name, int Size ) : int
Pop3GetMail ( IntPtr Socket, int No, StringBuilder Subject, StringBuilder Date, StringBuilder From, StringBuilder Header, StringBuilder Body, string Path, StringBuilder FileName ) : int
Pop3GetMailEx ( IntPtr Socket, int No, StringBuilder Subject, StringBuilder Date, StringBuilder From, StringBuilder Header, StringBuilder Body, string Path, StringBuilder FileName, byte Temp, int Flag ) : int
Pop3GetMailSize ( IntPtr Socket, int No ) : int
Pop3GetMailStatus ( IntPtr Socket, int No, StringBuilder Subject, StringBuilder Date, StringBuilder From, StringBuilder Header, bool SizeFlag ) : int
Pop3GetUidl ( IntPtr Socket, int No, StringBuilder Id, int Max ) : int

Method Details

Authenticate() public method

POP3 �T�[�o�F�؂�s���܂��B
POP3 �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 POP3 ���[�U�[ ID
pass_str string POP3 �p�X���[�h
return void

Authenticate() public method

POP3 �T�[�o�F�؂�s���܂��B
POP3 �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, bool apop_flag ) : void
id_str string POP3 ���[�U�[ ID
pass_str string POP3 �p�X���[�h
apop_flag bool APOP ��g�p���邩
return void

Close() public method

POP3 �T�[�o�Ƃ̐ڑ���I�����܂��B
public Close ( ) : void
return void

Connect() public method

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

Connect() public method

POP3 �T�[�o�ɐڑ����܂��B
POP3 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// POP �T�[�o�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( int port_no ) : void
port_no int �|�[�g�ԍ�
return void

Connect() public method

POP3 �T�[�o�ɐڑ����܂��B
POP3 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// POP �T�[�o�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( string host_name ) : void
host_name string POP3 �T�[�o�[��
return void

Connect() public method

POP3 �T�[�o�ɐڑ����܂��B
POP3 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// POP �T�[�o�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( string host_name, int port_no ) : void
host_name string POP3 �T�[�o��
port_no int �|�[�g�ԍ�
return void

DecodeHeaderField() public method

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

Delete() public method

���[����폜���܂��B

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

�w��̃��[���ԍ�(�ϐ���:no)��폜����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.Delete(no); 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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.Delete(no) 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 pop.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// ���[���ԍ�������������܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public Delete ( int no ) : void
no int ���[���ԍ�
return void

Dispose() public method

Pop3�ɂ���Ďg�p����Ă��邷�ׂẴ��\�[�X�������܂��B
public Dispose ( ) : void
return void

Dispose() protected method

Pop3�ɂ���Ď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 ///
return void

GetAttachmentFileStatus() public method

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

�Y�t�t�@�C���̕�������PartNo�Ŏ擾�ł��܂��B

NoAttachmentFile�̏ꍇ�Y�t�t�@�C���͂���܂���B

AttachmentFile�̏ꍇ��������Ă��Ȃ��Y�t�t�@�C���t�����[���ł��B

1 �ȏ�̏ꍇ��������Ă���Y�t�t�@�C���ŕԂ�l�̓p�[�g�ԍ���\���܂��B

1 �̏ꍇ�́AFlag��PartialAttachmentFile ��ݒ肵�� GetMail��Ăяo���ƓY�t�t�@�C����������ĕۑ��”\�ł��B

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// ���[���ԍ�������������܂���B ///
public GetAttachmentFileStatus ( int no ) : bool
no int ���[���ԍ�
return bool

GetDecodeHeaderField() public method

���[���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��
return string

GetDecodeHeaderField() public method

���[���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�_
return string

GetFileNameList() public method

�Y�t�t�@�C�����̔z��ł��B
public GetFileNameList ( ) : string[]
return string[]

GetHeaderField() public method

���[���w�b�_����w��̃t�B�[���h�̓�e��擾���܂��B
POP3 �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

�w��̃��[���ԍ�(�ϐ�:no)�� X-Mailer �w�b�_�t�B�[���h��擾����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetMail(no); MessageBox.Show("X-Mailer:" + pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetMail(no) MessageBox.Show("X-Mailer:" + pop.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 pop.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��
return string

GetHeaderField() public method

���[���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�_
return string

GetMail() public method

���[����擾���܂��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 /// /// ���[���ԍ�������������܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetMail ( int no ) : void
no int ���[���ԍ�
return void

GetSize() public method

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

���[���ԍ�(�ϐ���:no)�̃��[���T�C�Y��擾����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetSize(no); MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, pop.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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetMail(no) MessageBox.Show(String.Format("���[���ԍ�:{0:d},�T�C�Y:{1:d}", no, pop.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 pop.Dispose() End Try

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

GetStatus() public method

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

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

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

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

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

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

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// ���[���ԍ�������������܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetStatus ( int no ) : void
no int ���[���ԍ�
return void

GetUidl() public method

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

�擾���� UIDL ��Uidl�Ŏ擾�ł��܂��B

no��UidlAll��w�肷��ƁA POP3 �T�[�o��ɂ��邷�ׂẴ��[���� UIDL ��擾���܂��B

�w��̃��[���ԍ�(�ϐ���:no)�� UIDL ��擾����B using(nMail.Pop3 pop = new nMail.Pop3("mail.example.com")) { try { pop.Connect(); pop.Authenticate("pop3_id", "password"); pop.GetUidl(no); MessageBox.Show("Uidl=" + pop.Uidl); } 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 pop As nMail.Pop3 = New nMail.Pop3("mail.example.com") Try pop.Connect() pop.Authenticate("pop3_id", "password") pop.GetUidl(no) MessageBox.Show("Uidl=" + pop.Uidl) 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 pop.Dispose() End Try

/// �ڑ���Ԃł͂���܂���B(���������Ă��Ȃ����A�Ăяo����Ă��܂���B /// /// �T�[�o�Ƃ̌�M���ɃG���[���������܂����B /// �ɃG���[���b�Z�[�W�A /// �ɃG���[�R�[�h������܂��B ///
public GetUidl ( int no ) : void
no int ���[���ԍ�
return void

Init() protected method

�����������ł��B
protected Init ( ) : void
return void

Pop3() public method

Pop3�N���X�̐V�K�C���X�^���X����������܂��B
public Pop3 ( ) : System
return System

Pop3() public method

Pop3�N���X�̐V�K�C���X�^���X����������܂��B POP3 �T�[�o�[��
public Pop3 ( string host_name ) : System
host_name string
return System

SetHeaderSize() protected method

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

Property Details

_apop protected_oe property

APOP ��g�p���邩�ǂ����̃t���O�ł��B
protected bool _apop
return bool

_body protected_oe property

�{���i�[�o�b�t�@�ł��B
protected StringBuilder _body
return StringBuilder

_body_size protected_oe property

�{���̃T�C�Y�ł��B
protected int _body_size
return int

_cert_name protected_oe property

SSL �N���C�A���g�ؖ������ł��B
protected string _cert_name
return string

_count protected_oe property

���[�����ł��B
protected int _count
return int

_date protected_oe property

���t������ۑ��o�b�t�@�ł��B
protected StringBuilder _date
return StringBuilder

_err protected_oe property

�G���[�ԍ��ł��B
protected int _err
return int

_field protected_oe property

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

_field_name protected_oe property

�w�b�_�t�B�[���h���ł��B
protected string _field_name
return string

_filename protected_oe property

�Y�t�t�@�C�����i�[�o�b�t�@�ł��B
protected StringBuilder _filename
return StringBuilder

_filename_list protected_oe property

�Y�t�t�@�C�����̃��X�g�ł��B
protected string[] _filename_list
return string[]

_flag protected_oe property

���[����M���̐ݒ�p�t���O�ł��B
protected int _flag
return int

_from protected_oe property

���o�l�i�[�o�b�t�@�ł��B
protected StringBuilder _from
return StringBuilder

_header protected_oe property

�w�b�_�i�[�o�b�t�@�ł��B
protected StringBuilder _header
return StringBuilder

_header_size protected_oe property

�w�b�_�[�T�C�Y�ł��B
protected int _header_size
return int

_host protected_oe property

POP3 �T�[�o���ł��B
protected string _host
return string

_html_file protected_oe property

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

_id protected_oe property

POP3 ���[�U�[���ł��B
protected string _id
return string

_part_id protected_oe property

�����t�@�C���� ID �ł��B
protected StringBuilder _part_id
return StringBuilder

_part_no protected_oe property

�����t�@�C���ԍ��ł��B
protected int _part_no
return int

_password protected_oe property

POP3 �p�X���[�h�ł��B
protected string _password
return string

_path protected_oe property

�Y�t�t�@�C���ۑ��p�̃p�X�ł��B
protected string _path
return string

_port protected_oe property

POP3 �|�[�g�ԍ��ł��B
protected int _port
return int

_rfc822_file protected_oe property

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

_size protected_oe property

���[���T�C�Y�ł��B
protected int _size
return int

_socket protected_oe property

�\�P�b�g�n���h���ł��B
protected IntPtr,System _socket
return System.IntPtr

_ssl protected_oe property

SSL �ݒ�t���O�ł��B
protected int _ssl
return int

_subject protected_oe property

�����i�[�o�b�t�@�ł��B
protected StringBuilder _subject
return StringBuilder

_temp protected_oe property

�g���@�\�p�o�b�t�@�ł��B
protected byte[] _temp
return byte[]

_uidl protected_oe property

UIDL �i�[�o�b�t�@�ł��B
protected StringBuilder _uidl
return StringBuilder