How do I read incoming mail using C# [closed] - c#

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am looking for a solution to allow me to read incoming emails. The three methods I can think of to do this at the moment are:
Create an Email Server parsing emails
Hook into an existing exchange server
Hook into outlook that is already set up with an email account
What is the best way to do this? And how does one go about implementing it?
Thanks

If you are already dealing with an Exchange server as the mailbox host I would suggest leveraging that via IMAP (preferred) or POP access. Recently I developed a solution that accesses a specified mailbox via AfterLogic's MailBee.NET IMAP component which I think is worth the recommendation. They have a standard trial version and reasonable pricing. Also if you go this route either POP or IMAP automation is flexible enough to work with almost any mailbox server platform; It doesn't have to be limited to Exchange environments.
There are also free .NET IMAP components out there that may do the job as well. In my limited research I found that the free alternatives didn't quite meet all of my requirements or were not as easy to learn but your situation may differ. For completeness, here is a list of alternative / free IMAP libraries I considered before deciding to spend the money on MailBee:
ImapX - http://hellowebapps.com/products/imapx/
LumiSoft.Net Imap Client - http://www.lumisoft.ee/lswww/download/downloads/Net/
InterIMAP - http://interimap.codeplex.com/
To address the 2nd part of your question... The implementation in my recent project involved writing a very simple console application that references the MailBee.NET IMAP library. The console application has a standard config file and accepts command line arguments as parameters. We define Windows scheduled tasks to run the console application according to our process needs. I am sure you could do this any number of other ways but this was the simplest approach for our needs.

I know this is an older thread but I wanted to add a link to a great open source Imap library called ImapX2: http://imapx.codeplex.com/
I tried most of the links in this thread to varying degrees of success but I found that the ImapX2 library work the best according to my needs.

Use existing IMAP server and IMAP component for that.
Creating your own IMAP server is a big security risk in my opinion.
There are free components, but most of them have problems with national characters and 'not standard' email messages...and there is none support (LumiSoft.Net is abandoned for almost 2 years)
using(Imap imap = new Imap())
{
imap.Connect("imap.server.com");
imap.Login("user", "password");
imap.SelectInbox();
List<long> uidList = imap.Search(Flag.Unseen);
foreach (long uid in uidList)
{
IMail email = new MailBuilder()
.CreateFromEml(imap.GetMessageByUID(uid));
Console.WriteLine(email.Subject);
Console.WriteLine(email.Attachments.Count);
}
imap.Close();
}
Mail.dll also includes SMTP component and template engine so you can send replies easily.
Disclaimer: I'm involved in the development of this commercial product.

Related

How to implement IMAP Protocol (Server side) using C# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am trying to write a service that provide user a subdomain as mailbox.
So I need to implement IMAP server on my own.
I notice mimekit/mailkit may help me. (At least they can help me test my server.)
It is possible to implement a minimum IMAP Protocol (server side) using mimekit/mailkit?
I would say that MimeKit would certainly be helpful in that a significant part of writing an IMAP server (or even a POP3 or SMTP server) is that you will at some point need to deal with parsing messages and/or headers and MimeKit is a perfect solution for that.
There are parts of MailKit which might be helpful for implementing an IMAP server. For example, re-using the UniqueId (and related) classes for your IMAP server project would likely be useful. Likewise, if you eventually implement the THREAD extension, the MessageThreader class would be invaluable.
The ImapEncoding class would certainly be reusable.
You might be able to at least partially re-use the ImapStream (and ImapToken) class as your tokenizer for an IMAP server, but I'm not 100% sure on that since I've never looked at it from that perspective and there might be subtle differences there, but you could probably use it as a reasonable starting point.
ImapUtils.FormatInternalDate() would be a good candidate for re-use...
You might be able to reuse a lot of the FolderQuota and AccessControl classes as well if you end up supporting the QUOTA and/or ACL IMAP extensions (not that those classes do much).
I'm sure there are various other bits & pieces that would be helpful to re-use from MailKit, but you won't be able to easily turn the ImapClient class into an ImapServer class, for example.
And then, of course, as you mentioned in your post, you could always use MailKit as a great way of testing your IMAP server implementation to make sure things work.
Hope that helps answer your question.
Is it possible to implement a minimum IMAP Server using mimekit/mailkit?
Short answer: No!
The main goal of this project is to provide the .NET world with
robust, fully featured and RFC-compliant SMTP, POP3, and IMAP client
implementations.
You should beware of the huge difference between a mail server (which keeps your emails, is visible to the outside world and normally is 24/7 live) and a mail client which is mainly used to fetch the mails from that sever.

Recommendations for most secure real time data transfer [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have been asked to develop a system that collects data from a Sql Server database and send that data in "some" format to a client as real-time as possible. The data is basic contact forms from a .net website. Names, phone numbers, email. No SSN type data.
The only parameters I know about the project are:
The client will probably want multiple ways to consume to data.
Excel, Rss readers, lead management systems, etc.
The client has
expressed zero concern for security.
I am not going to just ignore
security because the client doesn't care.
Full Disclosure: I am NOT a security expert.
I want to use some type of secure rss/xml feed because that would seem to offer the most options for the client to consume and it would be as real time as possible. However, many of the posts on this topic here at SO seem to suggest even with basic authentication and SSL, you are asking for trouble.
I could setup up a secure FTP download, but this doesn't seem to make sense as it would require the client to constantly check for incoming contact forms/leads.
If all else fails I could just email CSV files every 2 or 3 minutes but this does not seem very good either.
I guess my main question is: Is there another way I am missing or is a secure Rss/Xml feed OK for this application?
Thanks.
IF the client is known then you can secure this rather good with SSL.
Use SSL not only on the server side but on the client-side too by requiring the clients identify themselves with a certificate... that certificate is installed once on the machine of the client/boss/whoever and made known to your server.
For some information on how to do this with IIS see:
http://support.microsoft.com/kb/315588/en-us
read client certificate from httprequest C#
http://www.iis.net/ConfigReference/system.webServer/security/authentication/iisClientCertificateMappingAuthentication

Looking for Recommendations on Version Control System with Intuitive (.NET) API? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this question
I'm working on a project which generates (composite) Microsoft Word documents which are comprised of one or more child documents. There are tens of thousands of permutations of the composite documents. Far too many for users to easily manage. Users will need to view/edit the child documents through the app which hides all of the nasty implementation details. A requirement of the system is that the child documents must be version controlled. That is what has been tripping me up.
I've been torn between using an off-the-shelf solution or rolling my own. At a minimum, the system needs to support get latest, get specific version, add new, rename and possibly delete. I’ve whiteboarded it enough to realize it won’t be a trivial task to create my own. As far as commercial systems I have VSS and TFS at my disposal. I've played with the TFS API some, but it isn’t as intuitive or well documented as I had hoped. I'm not averse to an open source solution (e.g. SVN), but I have less familiarity with them.
Which approach or tool would you recommend? Why? Do you have any links to API documentation you would recommend?
Environment: C#, VS2008, SQL Server 2005/2008, low volume (a few hundred operations per day)
SharePoint does a pretty good job of document management, with versioning, etc. It also has plenty of APIs and is a much more modern approach than using the COM layer for VSS. SP would be a good solution if you are writing this as an enterprise solution (dedicated server, etc), but not so good for a desktop or small-business/SOHO app.
Its actually pretty easy to get rolling with document versioning in Sharepoint. If you setup a new list you will be able to define version options for attachments and list items right in the SP list settings.
You can also get a much more detailed control over versioning by using the SP webservices. If your planning on doing all of your document access from within your application, and don't want to have to push users into the Sharepoint site I would use this approach. Here is a good tutorial to get started with SP versioning
Give a try to Plastic SCM. It's distributed, has a great GUI, it can work as centralized too and you'll find tons of .NET assemblies to hook your code.
alt text http://www.codicesoftware.com/images3mk/screenshots/visualize_4.JPG

Peer to Peer file transfer c# [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
Hey, I have been looking on google and I cannot seem to find anything about peer to peer transfer.
Basically, I want to be able to send a file from my computer to someone else's computer. Does anyone know of any guides that can help me with this?
Thanks.
Google "System.Net.PeerToPeer", a namespace available in the .NET 3.5 framework. You'll have no trouble finding docs and sample code.
If you really just want to "send a file from my computer to someone else's computer" using C# then you may not be looking for true p2p. You can just use raw TCP. For this you need the remote computer to listen for a connection, your computer to open a connection to the remote computer, and start sending data.
There's a very basic example on how to do something like that here.
If you are actually looking for true P2P then you're best off using an existing P2P network (otherwise there will be nobody but you and your other computer on it). There are a few C# BitTorrent libraries around - for example BitSharp, TorrentNet. There is a whole question about BitTorrent libraries written in pure C#.
If the destination computer is able to expose a URI to publish to then you can simply use
WebClient.UploadFile(Uri address, string filename)
It very simply just takes a URI as address (http, ftp, even the file protocol to transfer to a folder share).
But that does require setting up something server side to publish to, but it would be platform independent on the server (e.g. any old FTP server, or a web page or service that accepts a file by POST method). Security may be an issue you need to consider however.
That's using a push model. WebClient can also be used from the other side to download. It also supports transfer of data streams, strings, etc.
Have a look at this project on Code Project.
It provides for P2P chat and file transfer and could be either an inspiration or a solution.

SMS Library for .NET [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Anyone know of a free SMS library or webservice for .NET that will allow me to send text messages to people's cell phones?
What are you looking for actually? a Library or a Proxy?
a Library is just an API that you can program to in a user-friendly way... that, there are hundreds out there, because that you need to add all the payed proxies, they all give you an API to program to.
If you are talking about Proxies, 98% of the proxies out there are not for free, and you need to pay a monthly basis amount of per SMS sent, it's up to you. All of them have trial versions (for example 100 SMS that you can send for free... normally called Credits).
There is some open source projects for SMS proxies, but for the Linux world like Kannel.
You can make your own using COMM interface and have a old mobile with a card that you can send commands to and make your own API interface based on that (there are plenty of SMS free packages and you might have it as well in your country)
for now... try this link:
http://email2sms.ru/sms.php
and a nice but old article on how to send sms using your own phone:
http://www.oreillynet.com/pub/a/wireless/2003/10/10/sms.html
Try bulksms, very cheap and provide an incoming and outgoing service in pretty much every country for local SMS rates.
ReadWriteWeb
http://www.readwriteweb.com/archives/zeep_mobile_free_sms_gateway.php
Clickatel and most other SMS gateway providers provide some trial credits. And some service providers provide Email2SMS conversion. i.e You can send an email to +94xxxxxxx#yourprovider.com and it will be sent as an SMS.
These information does not answer your question directly but they would be useful in your taks..
Use a SMS provider like clickatell. Sending a SMS is just a matter of sending a correct HTTP GET request containing your account information, the message and the recipient. See: http://support.clickatell.com/guides/clickatell/api_guide.php.
From .NET, you simply use the System.Net.WebClient class to create a correct HTTP GET request. Docs: http://msdn.microsoft.com/en-us/library/system.net.webclient(VS.80).aspx
Actually I found a pretty good one called PennySMS. It has a pretty good and simple web service I can consume and seems to work with all different types of cell phones.

Categories