|
-
Mar 26th, 2013, 10:57 AM
#1
Thread Starter
Addicted Member
modify email function
The below function retrieves a pop3 email message once the server is connected. I'd like to modify this function so that it doesn't download any email attachments. I'm trying to write some code to just view the email subject and the from email. Big attachments can slow down the execution of the program.
*******************
Function GetMessage(ByVal msgindex As Integer) As String
Dim tmpString As String
Dim Data As String
Dim SzData() As Byte
Dim msg As String
Try
Data = "RETR " & msgindex.ToString & vbCrLf
SzData = System.Text.Encoding.UTF8.GetBytes(Data.ToCharArray())
NetStrm.Write(SzData, 0, SzData.Length)
tmpString = RdStrm.ReadLine()
If tmpString.Substring(0, 4) <> "-ERR" Then
While (tmpString <> ".")
msg = msg & tmpString & vbCrLf
tmpString = RdStrm.ReadLine
End While
End If
Catch exc As InvalidOperationException
MsgBox("Message Retrival Failed: " & vbCrLf & Err.ToString())
End Try
Return msg
End Function
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|