Author |
|
Dollar88 Newbie
Joined: 17 October 2008 Location: United States
Online Status: Offline Posts: 3
|
Posted: 17 October 2008 at 7:38am | IP Logged
|
|
|
I'm a .NET programmer and am not too familiar with SMTP and POP3. I need to create a windows service that passes all the info in the .NET Mail object as the email comes in to a Web Service.
My first idea was to put a watch on the drop folder, and parse the .eml file, but was wondering if there was a more attractive way to accomplish this.
Wasn't sure if this Component could help me out? Any suggestions would be appreciated.
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 17 October 2008 at 10:08am | IP Logged
|
|
|
If you already have an SMTP service which receives incoming messages and places them as .eml files to a folder and you need to develop another service which would pickup those e-mails and process them, watching the folder via FileSystemWatcher and processing via MailBee.NET Objects is a good idea.
In case if you need to listen SMTP port to receive incoming mails from other SMTP servers, this cannot be done via MailBee.NET SMTP as it's a component for developing SMTP clients, not servers. In other words, it can connect to other SMTP servers and send messages, but it can't receive messages from them.
Perhaps, you have a full mail server (i.e. SMTP + POP3 or IMAP) up-and-running which receives incoming messages. In this case, your service may periodically connect to the mail server via POP3 or IMAP to download new messages and process them. In this case, MailBee.NET POP3 or MailBee.NET IMAP component would be useful to you. Please note, POP3 protocol doesn't allow distinguishing between old and new messages, so you'd need to implement storing UIDs of already downloaded messages in your application. IMAP protocol supports server-side flags that allows downloading only new messages without storing the UIDs.
Also, many IMAP servers support IDLE extension which allows your application to stay connected to the IMAP server and listen for incoming messages that allows you to avoid polling the server and receive messages immediately as they arrive to the server.
Best regards,
Andrew
|
Back to Top |
|
|
Dollar88 Newbie
Joined: 17 October 2008 Location: United States
Online Status: Offline Posts: 3
|
Posted: 20 October 2008 at 12:02pm | IP Logged
|
|
|
Andrew,
Thanks for the feedback. That was very helpful information.
I am pretty sure we are going to go the FileSystemWatcher route. One question.
Will the MailBee.NET Objects be able to translate the .eml file into an object where I will be able to retrieve all of the elements related to an email?
I was hoping I don't have to parse the .eml file and get the data myself.
Thanks again for the info.
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 20 October 2008 at 1:37pm | IP Logged
|
|
|
Yes. You should just load necessary message via MailMessage.LoadMessage method and access necessary message properties.
Best regards,
Andrew
|
Back to Top |
|
|
Dollar88 Newbie
Joined: 17 October 2008 Location: United States
Online Status: Offline Posts: 3
|
Posted: 20 October 2008 at 1:40pm | IP Logged
|
|
|
Awesome.
Thanks for your help Andrew.
|
Back to Top |
|
|