Dart.Mail Namespace > PopMessage Class > Get Method : Get(Stream,Int32) Method |
Public Overloads Sub Get( _ ByVal destination As Stream, _ ByVal bodyLines As Integer _ )
Dim instance As PopMessage Dim destination As Stream Dim bodyLines As Integer instance.Get(destination, bodyLines)
public void Get( Stream destination, int bodyLines )
public: void Get( Stream* destination, int bodyLines )
public: void Get( Stream^ destination, int bodyLines )
This method gets a partial message. Part.GetEncodingStream is typically used as the destination Stream for on-the-fly decoding, but storage streams can be used to store the message without decoding it.
This method will set Info as applicable for the value of bodyLines.
private void previewMessages(object sender) { //Configure server and account info pop1.Session.RemoteEndPoint = new Dart.Mail.IPEndPoint(myServer, Pop.GetDefaultPort(pop1.Session)); pop1.Session.Username = myUsername; pop1.Session.Password = myPassword; //Connect and log into the account pop1.Connect(); pop1.Authenticate(true, true); //Get header fields for each message in the account foreach (PopMessage popMessage in pop1.Messages) popMessage.Get(0); //Gracefully logout of the session pop1.Close(); } private void pop1_Progress(object sender, PopProgressEventArgs e) { //Display message header info in a listview if (e.Final) { string[] header = { e.Message.Message.From, e.Message.Message.Subject, e.Message.Message.Date.ToString() }; listView1.Items.Add(new ListViewItem(header)); } }
Private Sub previewMessages(ByVal sender As Object) 'Configure server and account info pop1.Session.RemoteEndPoint = New Dart.Mail.IPEndPoint(myServer, Pop.GetDefaultPort(pop1.Session)) pop1.Session.Username = myUsername pop1.Session.Password = myPassword 'Connect and log into the account pop1.Connect() pop1.Authenticate(True, True) 'Get header fields for each message in the account For Each popMessage As PopMessage In pop1.Messages popMessage.Get(0) Next popMessage 'Gracefully logout of the session pop1.Close() End Sub Private Sub pop1_Progress(ByVal sender As Object, ByVal e As PopProgressEventArgs) Handles pop1.Progress 'Display message header info in a listview If e.Final Then Dim header() As String = { e.Message.Message.From, e.Message.Message.Subject, e.Message.Message.Date.ToString() } listView1.Items.Add(New ListViewItem(header)) End If End Sub