![]() |
C#: How to parse emails? Hi, Anyone know the code or how to parse through emails that a site gives you and click the links inside of them. Im using the dll OpenPop3 but so far have only figured out how to login. Any help would be appreciated |
Re: C#: How to parse emails? Just download the emails with the POP3 connection, then you can use the following regex to match all the links. #(http|https|ftp)://([A-Z0-9][A-Z0-9_-]*(?:.[A-Z0-9][A-Z0-9_-]*)+):?(d+)?/?#i |
Re: C#: How to parse emails? Can I use OpenPop3 or do I use the built in support for POP3 that C# brings? |
Re: C#: How to parse emails? I checked out OpenPop3 on SourceForge but I don't see any files or examples so I can't tell you for sure. I imagine its just a helper library to communicate with the built in POP3 functions so I don't see why not, try reading the documentation. Also, I found another similar library called OpenPop OpenPop.NET | Free Communications software downloads at SourceForge.net which seems to actually have files to download and it says it supports all the common POP3 functions and email MIME types. |
Re: C#: How to parse emails? This is what I have so far: Code: Pop3Client client = new Pop3Client(); |
Re: C#: How to parse emails? You could looks for the characters "<a href", then split the strings up til you find the immediate next "</a>". Then add all those split strings into a generic list. Once they're in a generic list you can bind that list to a repeater, and dynamically create them as a page you could click the links on. Here's some info on generic lists: An Introduction to C# Generics |
Re: C#: How to parse emails? I know it looks like a bunch of gobbleygook, but you should really use the Regular Expression method that unnatural posted. C# has a great Regular Expression library and there is tons of free sample code out there. You can literally parse ALL LINKS out of an email in 3-4 lines of code. gtownfunk |
| All times are GMT -6. The time now is 06:54 PM. |