0

I'd like to make a stripped down email client for my pre-schooler using Silverlight 3 and pulling email from a Gmail account.

I'll have some filters setup in Gmail so that only a subset of email is given a particular label, similar to creating a whitelist. Then, I'd like to pull those emails with that label to the Silverlight client. I'd like to avoid running any of the messages through the server (so that I can share this application with friends and not have their email app require a server).

I've never written any sort of email client (POP3 or IMAP) and am not sure if this will even be possible. Looking through the various libraries available for retrieving via IMAP, I can't find references to using a browser-limited client such as Silverlight.

Also, I'm guessing I'll be able to send via .NET built in SMTP objects in Silverlight, but haven't tested this yet either.

Can anyone point me in the right direction; tell me why this may or may not be feasible; or relate their own experiences regarding this type of challenge?

Feckmore
  • 4,322
  • 6
  • 43
  • 51
  • Sending mail over SMTP via .NET is easy, although with Gmail you'll need to check if SMTP with STARTTLS is supported. The problem is IMAP is fairly hairy as open-source protocols go, so a good library is essential. I don't know enough about Silverlight to comment, but could any of the C# libraries mentioned in http://stackoverflow.com/questions/670183/accessing-imap-in-c be used? – sigint Jul 20 '09 at 15:49
  • I don't get the "I'd like to avoid running any of the messages through the server" part. How can you retrieve email without running it through the server? Or are you talking about the web server? – innaM Jul 20 '09 at 19:47
  • @Manni, I was wondering if it was possible to communicate directly from the Silverlight client to the Gmail server and skipping my server in-between. – Feckmore Jul 21 '09 at 15:35

2 Answers2

4

Silverlight does not yet allow arbitrary socket connections, which you would need to connect to an IMAP server on the privileged port of 143. Silverlight can only connect to servers, even with a client access policy file, on ports 4502-4534.

Your only options are to proxy to gmail via a server on those ports, or just do the IMAP work on the server and serve it down to the client app over HTTP.

Sorry about this-- enhanced socket support is always being looked at, but it has scary security implications and hasn't been implemented yet. Good luck finding a solution to your scenario.

Jason Prado
  • 1,504
  • 2
  • 12
  • 21
0

There is a great example of a Silverlight based mail client here:

http://silvermail.com.au

I use this regularly to check my personal email from work, and I know that it works with GMail.

Hope that helps.

  • Interesting... I'm guessing they are pulling your credentials (username & password) onto their server and doing the work via services. I'd only use this for very unimportant accounts. – Feckmore Oct 14 '09 at 17:34