Comments (30)
It's not that hard to make, what exactly do you need? An command line tool that scans a folder for all the *.msg files and then writes all the recipient e-mail addresses to a file? Can you give me your exact specifications?
from msgreader.
Hi,
I thought it would not be so hard to make, i actually tried to compile your project with SharpDevelop and then write the for loop and remove all the gui stuff, but then i got stuck with all the dependancies and assembly stuff i don't know about :)
Basically, i get emails from hotmail and yahoo that keep me informed that on of their users complained about a newsletter i sent them. Every email contains an RFC822 attachment with the initial mail.
As for now, i open them manually, copy paste the mail to a file and then unsubscribe them from my mailing list.
In the ideal way, i'd like to put all these mails in a folder in .msg format, and then use a tool that would extract all recipient adresses, with the possibilty to ignore some of them.
Basically it would look like
c:>magic_tool.exe --scanfolder=c:\mycomplaintmails*.msg --recipients-list=c:\email_list.exe --ignore=[email protected],[email protected]
I would use this tool myself and i guess some people at phplist would like to use that too. I'm writing some howtos for phplist right now, and the only tool i found so far that can to this has a fancy interface which i can't include in a script.
Regards,
Ozy.
from msgreader.
What I can make for you is a simple commandline tool that you can use like this.
ExtractRecipients.exe "c:\somefolder" "c:\someoutputfile.txt"
And then extract all the recipient addresses that are in the *.msg or *.eml files that are in the folder.
from msgreader.
That would be absolutely great.
As for the exclude part, i can handle this with a simple batch script too :)
from msgreader.
You are sure you need the recipient and not the from address? Normally the recipient is the person that receives the E-mail.
And what do you need to exclude?
from msgreader.
The recipient it is. But it's the recipient from the .msg attachment in the .msg file, sorry if i wasn't clear about this in the first place, because i begun working with the initial project you forked, which is able to dive into the attachment. The initial bug i encountered was that underscore emails didn't make it into the list.
I need to exclude arbitrary email addresses from the recipient's lists (like mine when i do some tests), in order to not blacklist myself automatically. But don't bother with the exclude stuff, i can handle this with a simple script.
from msgreader.
So... extract the msg attachment first and then read the recipient from that attachment?
from msgreader.
Yes :)
from msgreader.
Ok I'll make something quick and dirty... give me an hour or so
from msgreader.
Wow :) Now that's a fast dev. Mail me your paypal so i can buy you at least some coffee for the time spent.
from msgreader.
Just a question... looking to you name? Are you dutch?
from msgreader.
My familiy is, so is my passport. But i grew up in Germany and now live in France.
from msgreader.
Ok.. the reason why I asked because I'm dutch :-)
from msgreader.
Guessed so, i saw your your name on Code Project :)
from msgreader.
I added an utilities folder to the solution. In there you will find a console application that is called EmailExtractor. This program should do what you need.
from msgreader.
Got the mail.
from msgreader.
I also added comment to the code to give you an idea how you can get everything out of an msg file.
from msgreader.
Great ! Would you mind building and sending me an exe ?
As i tried to compile your project in the first place, i had a lot of dependancies issues with nuget.
My email address shall appear on the paypal receipt in some minutes.
from msgreader.
The E-mail is on its way
from msgreader.
If you want to fiddle around with the source and avoid the nuget dependencies than just browse to the Utilities\EmailExtractor folder and open the "EmailExtractor.csproj" file. You then should only have the emailextractor project and nothing else.
Let me know if the program does what you need.
from msgreader.
Got to test it, but output file does stays empty.
Here's my test output from the program
Found '5' files to process
Checking file 'C:\Users\user\Desktop\FC\test\complaint about message from xxxxxxxxxxxx.msg'
Found '1' attachments
Found msg file 'subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\complaint about message from xxxxxxxxxxxx.msg'
Found '1' attachments
Found msg file 'subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\complaint about message from xxxxxxxxxxxx.msg'
Found '1' attachments
Found msg file 'subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\subject.msg'
Found '2' attachments
Found msg file subject'
Recipient ''
Checking file 'C:\Users\user\Desktop\FC\test\subject.msg'
Found '0' attachments
Shall i send you one of the mails so you can see what happens ?
from msgreader.
Yes please.. that should make it easier for me to debug
from msgreader.
Email sent.
from msgreader.
Tried to open the csproj from utilities. Get "Tools version "12" is unrecognized"
I guess i have to get VisualStudio Express ? What IDE are you working with ?
from msgreader.
I'm using Visual Studio 2013 Ultimate. But you should be able to open the file with Visual Studio Express.
I fixed the issue. The E-mail adress is in the displayname field. Normally it should not be there. But it happens like in your situation. So I first check the Email field and if that is empty use the displayname field.
from msgreader.
Works as expected now, really thanks !
I'll fork this and add one or two basic functionnalities i'll need (for some emails that don't contain attachments, i need to extract thee sender and not the recipient's address in that case).
Anyway, another thank you is minimum that i should say.
You simply make me gain 1 hour per week with this little gem.
And i guess the community at phplist will find this usefull too.
from msgreader.
Hi,
Good to hear that it works as expected.
Greetings and have a nice weekend,
Kees
from msgreader.
Just for info, i was able to compile this with SharpDevlop after installing MS build tools 2013.
Thanks again.
from msgreader.
I don't know if you need it but I added some mailing list properties to the msgreader:
- MailingListHelp
- MailingListSubscribe
- MailingListUnsubscribe
With these properties you can retrieve mailing list information like so:
if (!string.IsNullOrWhiteSpace(msg.MailingListSubscripe))
Console.WriteLine("Mailing list subscribe page: '" + msg.MailingListSubscripe + "'");
You then for example can use it to see from which mailing list a message is returned.
from msgreader.
Great :) This could actually help me removing a user from a specific mailing list instead of blacklist em on all. Thanks alot.
from msgreader.
Related Issues (20)
- Add support for strong naming HOT 1
- Image does not appear on html while extracting the msg file to particular folder. HOT 3
- Is possible to generate html with embeded images ? HOT 3
- Is it possible to get the Outlook conversation id from a message? HOT 5
- Japanese subject sometimes fail to parse HOT 3
- File Nameless.txt as an attachment for digital signed emails HOT 11
- Status request on Reported Issue in Library #380 HOT 1
- v5.5.3 uses Microsoft.IO.RecyclableMemoryStream 3.0.0 HOT 28
- System.TypeInitializationException: The type initializer for 'MsgReader.Rtf.Font' threw an exception. HOT 7
- [Request] Update Microsoft.IO.RecyclableMemoryStream dependency to 3.0 HOT 1
- Subject line in opened message does not handle Unicode characters correctly? HOT 2
- Strange attachment names when parsing some .msg files HOT 6
- Strong Naming needed HOT 1
- MsgReader.Mime.Message.Save(FileInfo fileInfo) does not dispose FileStream HOT 1
- Getting files from Sender/Reciever signature as an msg.attachment HOT 1
- Regression: Nested signed mail showed as nameless.eml HOT 6
- Subject special characters not properly displayed in .NET 8 (worked in .NET Framework 4.7.2) - same MSGReader version HOT 21
- Determining inline attachments - 2 HOT 2
- GetEmailRecipientsRfc822Format() method throws a System.ArgumentOutOfRangeException HOT 2
- System.TypeInitializationException: 'The type initializer for 'MsgReader.Rtf.Font' threw an exception.' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from msgreader.