reference System.Net (Windows CE)

2

good afternoon,

I add the reference System.net to be able to send emails but it happens that when I add the reference from the location of this, for some reason I do not load the System.Net if not System.Net.Irda and for this reason the MailMesasage and it does not work for me, what could I do or how can I send an email with Windows CE

Apart from being able to send the emails, they must have attached an excel file that has some data that are filled out,

I do not know how I could solve this problem.

Thanks

    
asked by Cristian R.M 10.08.2016 в 19:58
source

1 answer

2

The compact framework 3.5 does not support system.net.mail or system.web.mail but you can use OpenNETCF.Net.Mail which is available in SDF

Example:

var message = new MailMessage();

message.From = new MailAddress("[email protected]");
message.To.Add(new MailAddress("[email protected]"));
message.Subject = "Asunto";
message.Body = "Cuerpo del Mensaje";

var client = new SmtpClient();

client.Host = "smtp.miservidor.com";
client.Credentials = new SmtpCredential("usuario", "password", "midominio");

client.Send(message);

Another Solution is to create a webservice and there use System.Net to send mails.

    
answered by 10.08.2016 в 20:10