PDA

View Full Version : receiving email in vb.net


redundant
06-10-2004, 10:47 AM
hey guys

i'm doing a school project in vb.net and i need to be able to take an email from a webserver and load the body of the email into a variable as a string. and no, that's not the entire assignment, so you wouldn't be doing it for me, i just need this little piece.

anyway, if anyone could help it would be greatly appreciated.

Celtboy
06-11-2004, 11:15 PM
First off, you'll have to read the entire message into a string. Then parse the string out for just the body.


fileName =
sContents = GetFileContents("C:\test.txt", sErr)
If sErr = "" Then
Debug.WriteLine("File Contents: " & sContents)
'Save to different file
bAns = SaveTextToFile(sContents, "D:\Test.txt", sErr)
If bAns Then
Debug.WriteLine("File Saved!")
Else
Debug.WriteLine("Error Saving File: " & sErr)
End If

Else
Debug.WriteLine("Error retrieving file: " & sErr)
End If


borrowed from: http://www.freevbcode.com/ShowCode.asp?ID=4492