C# Класс 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

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_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

Открытые методы

Метод Описание
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�[��

Защищенные методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Authenticate() публичный Метод

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
Результат void

Authenticate() публичный Метод

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���邩
Результат void

Close() публичный Метод

POP3 �T�[�o�Ƃ̐ڑ���I�����܂��B
public Close ( ) : void
Результат void

Connect() публичный Метод

POP3 �T�[�o�ɐڑ����܂��B
POP3 �T�[�o�ɐڑ����܂��B
/// �|�[�g�ԍ�������������܂���B /// /// POP �T�[�o�[�Ƃ̐ڑ��Ɏ��s���܂����B /// �ɃG���[�R�[�h������܂��B ///
public Connect ( ) : void
Результат void

Connect() публичный Метод

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�ԍ�
Результат void

Connect() публичный Метод

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�[��
Результат void

Connect() публичный Метод

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�ԍ�
Результат void

DecodeHeaderField() публичный Метод

MIME �w�b�_�t�B�[���h�̕������f�R�[�h���܂�
public DecodeHeaderField ( string field ) : string
field string �t�B�[���h�̕�����
Результат string

Delete() публичный Метод

���[����폜���܂��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 ���[���ԍ�
Результат void

Dispose() публичный Метод

Pop3�ɂ���Ďg�p����Ă��邷�ׂẴ��\�[�X�������܂��B
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

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 ///
Результат void

GetAttachmentFileStatus() публичный Метод

�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 ���[���ԍ�
Результат bool

GetDecodeHeaderField() публичный Метод

���[���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��
Результат string

GetDecodeHeaderField() публичный Метод

���[���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�_
Результат string

GetFileNameList() публичный Метод

�Y�t�t�@�C�����̔z��ł��B
public GetFileNameList ( ) : string[]
Результат string[]

GetHeaderField() публичный Метод

���[���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��
Результат string

GetHeaderField() публичный Метод

���[���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�_
Результат string

GetMail() публичный Метод

���[����擾���܂��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 ���[���ԍ�
Результат void

GetSize() публичный Метод

���[���̃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 ���[���ԍ�
Результат int

GetStatus() публичный Метод

���[���̃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 ���[���ԍ�
Результат void

GetUidl() публичный Метод

���[���� 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 ���[���ԍ�
Результат void

Init() защищенный Метод

�����������ł��B
protected Init ( ) : void
Результат void

Pop3() публичный Метод

Pop3�N���X�̐V�K�C���X�^���X����������܂��B
public Pop3 ( ) : System
Результат System

Pop3() публичный Метод

Pop3�N���X�̐V�K�C���X�^���X����������܂��B POP3 �T�[�o�[��
public Pop3 ( string host_name ) : System
host_name string
Результат System

SetHeaderSize() защищенный Метод

�w�b�_�i�[�p�o�b�t�@�̃T�C�Y����肵�܂��B
protected SetHeaderSize ( ) : void
Результат void

Описание свойств

_apop защищенное свойство

APOP ��g�p���邩�ǂ����̃t���O�ł��B
protected bool _apop
Результат bool

_body защищенное свойство

�{���i�[�o�b�t�@�ł��B
protected StringBuilder _body
Результат StringBuilder

_body_size защищенное свойство

�{���̃T�C�Y�ł��B
protected int _body_size
Результат int

_cert_name защищенное свойство

SSL �N���C�A���g�ؖ������ł��B
protected string _cert_name
Результат string

_count защищенное свойство

���[�����ł��B
protected int _count
Результат int

_date защищенное свойство

���t������ۑ��o�b�t�@�ł��B
protected StringBuilder _date
Результат StringBuilder

_err защищенное свойство

�G���[�ԍ��ł��B
protected int _err
Результат int

_field защищенное свойство

�w�b�_�t�B�[���h��e�i�[�o�b�t�@�ł��B
protected StringBuilder _field
Результат StringBuilder

_field_name защищенное свойство

�w�b�_�t�B�[���h���ł��B
protected string _field_name
Результат string

_filename защищенное свойство

�Y�t�t�@�C�����i�[�o�b�t�@�ł��B
protected StringBuilder _filename
Результат StringBuilder

_filename_list защищенное свойство

�Y�t�t�@�C�����̃��X�g�ł��B
protected string[] _filename_list
Результат string[]

_flag защищенное свойство

���[����M���̐ݒ�p�t���O�ł��B
protected int _flag
Результат int

_from защищенное свойство

���o�l�i�[�o�b�t�@�ł��B
protected StringBuilder _from
Результат StringBuilder

_header защищенное свойство

�w�b�_�i�[�o�b�t�@�ł��B
protected StringBuilder _header
Результат StringBuilder

_header_size защищенное свойство

�w�b�_�[�T�C�Y�ł��B
protected int _header_size
Результат int

_host защищенное свойство

POP3 �T�[�o���ł��B
protected string _host
Результат string

_html_file защищенное свойство

text/html �p�[�g��ۑ������t�@�C���̖��O�ł��B
protected StringBuilder _html_file
Результат StringBuilder

_id защищенное свойство

POP3 ���[�U�[���ł��B
protected string _id
Результат string

_part_id защищенное свойство

�����t�@�C���� ID �ł��B
protected StringBuilder _part_id
Результат StringBuilder

_part_no защищенное свойство

�����t�@�C���ԍ��ł��B
protected int _part_no
Результат int

_password защищенное свойство

POP3 �p�X���[�h�ł��B
protected string _password
Результат string

_path защищенное свойство

�Y�t�t�@�C���ۑ��p�̃p�X�ł��B
protected string _path
Результат string

_port защищенное свойство

POP3 �|�[�g�ԍ��ł��B
protected int _port
Результат int

_rfc822_file защищенное свойство

message/rfc822 �p�[�g��ۑ������t�@�C���̖��O�ł��B
protected StringBuilder _rfc822_file
Результат StringBuilder

_size защищенное свойство

���[���T�C�Y�ł��B
protected int _size
Результат int

_socket защищенное свойство

�\�P�b�g�n���h���ł��B
protected IntPtr,System _socket
Результат System.IntPtr

_ssl защищенное свойство

SSL �ݒ�t���O�ł��B
protected int _ssl
Результат int

_subject защищенное свойство

�����i�[�o�b�t�@�ł��B
protected StringBuilder _subject
Результат StringBuilder

_temp защищенное свойство

�g���@�\�p�o�b�t�@�ł��B
protected byte[] _temp
Результат byte[]

_uidl защищенное свойство

UIDL �i�[�o�b�t�@�ł��B
protected StringBuilder _uidl
Результат StringBuilder