0

JavaMail, for those who dont know.

Anyway, is there an equivalent to this in C#/.Net? I need to access my Gmail account for testing purposes, but using a regular automation tool would be too hard.

I need to be able to read and parse GMail. Similar to what this article is doing in Java: http://seleniumsoftwaretesting.blogspot.com/2011/08/verify-email-confirmation-using.html

James
  • 5,482
  • 9
  • 33
  • 42

4 Answers4

3

Have a look at System.Net.Mail

Daniel A. White
  • 181,601
  • 45
  • 354
  • 430
1

http://msdn.microsoft.com/en-us/library/system.net.mail.smtpclient.aspx

This is available. I didn't see where you listed what features of JavaMail you needed, but this is one mail option.

Jared
  • 5,455
  • 5
  • 47
  • 78
1

If you are looking to download / parse messages (rather than just send them, which is provided in System.Net.Mail as others have said) you can look at this free option:

http://www.codeproject.com/KB/IP/despop3client.aspx

There are paid options as well, such as Aspose.Network for .NET:

http://www.aspose.com/categories/.net-components/aspose.network-for-.net/default.aspx

Nathan Anderson
  • 6,640
  • 24
  • 29
  • Even though I wont up using a different product, this post helped point me into the right direction. Ultimately I needed something to download and parse. It was my fault for not specifying that in the OP – James Aug 15 '11 at 16:35
0

The nuget package AE.Net.Mail is an analog or equivalent to JavaMail for reading/parsing email in the RFC 2822 format. I used it with the Gmail API to get the "Raw" property that the Gmail API wants. See the code here for a code sample: Creating a Message for Gmail API in C#

The library's project: https://github.com/andyedinborough/aenetmail

Community
  • 1
  • 1
pettys
  • 2,220
  • 26
  • 36