FEZ Spider Missing System.net.mail


I’m working with Visual Studio 2013 Community, with Microsoft .net Micro Framework 4.3 (QFE2), Microsoft .net Gadgeteer Core and GHI Electronics NETMF SDK 2015 R1 Pre Release 3. I would like to implement a Smtp funtion that can be used to send a email containing an attachment from a SDCard Module. Unfortunately im not seeing the reference System.net.Mail. Where can i find it, or if need be where can i download it from?

The following is a snippet of code that i wish to implement.

MailMessage mymail = new MailMessage();

mymail= new MailMessage (textBox2.Text.Trim(), textBox1. Text.Trim());

mymail.Subject = textBox3.Text.Trim();

mymail.IsBodyHtml = true;

mymail.Body = richTextBox1.Text.Trim();

SmtpClient client = new SmtpClient(ComboBox1.SelectedItem.ToString().Trim(), Convert.ToInt32(textBox7.Text.Trim()));

client.UseDefaultCredentials = false;

client.Credentials = new System.Net.NetworkCredential(textBox2.Text.Trim(), textBox 5.Text.Trim());

Attachement myAttach = new Attachment(ms, Ststem.Net.Mime.MediaTypeNames.Image.Jpeg);

myAttach.ContentDispostion.FileName = j.ToString()+".jpg";


Thank you in advance.

Im a summer time worker doing a R and D project with only C++ knowledge. Learning C# for the first time while doing this project.

@ RDGallow
Hello, welcome to the Forum.
As far as I know System.net.mail is not included in NETMF 4.3.
Perhaps you can get same helpful Information from this thread:

1 Like

@ RDGallow - I don’t think .NET Micro Framework natively supports email.

Here are a couple of possible solutions:

This is a sample I wrote:

It probably needs to be updated to work with NETMF 4.3, but I wrote it for the Spider and the Ethernet module that shipped with the FEZ Spider Starter Kit.

This one is a bit older, but may be helpful in terms of anything I missed in my implementation:


In either case, you should be able to add a class file to your project, paste in the relevant code, and reference the class from your Gadgeteer code.

Hope that helps!

1 Like

@ RoSchmi and @ devHammer thank you for all your help.

:slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile: :slight_smile:

@ RDGallow - My pleasure. Let us know how it works for you!