Re: email con mono
christian valdivia <[email protected]>
| Newsgroups | gmane.comp.gnome.mono.hispano |
|---|---|
| Message-ID | <[email protected]> |
El Problema fué resuelto gracias a Juan C. Olivares el problema son los certificados esta es la página que Juan C Olivares muy amablemente me facilito: http://www.mono-project.com/FAQ:_Security mi systema operativo es GNU/Debian 2.6.30-1-68 sid Mono JIT compiler version 2.4.2.3 dentro de esa página: http://www.mono-project.com/FAQ:_Security ************http://www.mono-project.com/FAQ:_Security******** Does SSL works for SMTP, like GMail ? Yes it does. First you must import the root certificates using the mozroots tool: mozroots --import --ask-remove Note that if you are using a web application (i.e. not the current user) you must add the --machine option like this: mozroots --import --ask-remove --machine Next you need to import the intermediate certificates. You can do this by using the certmgr tool to connect to the SSL server. E.g. certmgr -ssl smtps://smtp.gmail.com:465 Use the -m option to import the certificates into the machine store if required. Finally you need to make sure to use the SSL-enabled port in your application. This is generally 465 or 587 instead of port 25. ************http://www.mono-project.com/FAQ:_Security******** en consola se añade: 1.- mozroots --import --ask-remove 2.- mozroots --import --ask-remove --machine listo.. despues de esto el código funcionó. =============================================== Gracias por el soporte Juan C. Olivares. =============================================== El 10 de agosto de 2009 14:51, Juan C. Olivares<[email protected]> escribió: > Christian: > Usé tu código y funcionó muy bien. Lo compilé como gmcs y ejecuté con mono > 2.4. > > On Mon, Aug 10, 2009 at 3:12 PM, christian valdivia > <[email protected]> wrote: >> >> public class enviarMensajeCorreo >> { >> >> public enviarMensajeCorreo() >> { >> >> System.Net.Mail.MailMessage Mensaje = new >> System.Net.Mail.MailMessage(); >> Mensaje.From = new >> System.Net.Mail.MailAddress("[email protected]", "miNombre", >> System.Text.Encoding.UTF8); >> >> Mensaje.To.Add("[email protected]"); >> Mensaje.Subject = "saludos"; >> Mensaje.Body = "este es un mensaje"; >> Mensaje.SubjectEncoding = >> System.Text.Encoding.UTF8; >> Mensaje.BodyEncoding = >> System.Text.Encoding.UTF8; >> Mensaje.IsBodyHtml = false; >> >> System.Net.Mail.SmtpClient smtpcliente = >> new System.Net.Mail.SmtpClient(); >> smtpcliente.Credentials = new >> System.Net.NetworkCredential("micorreo@gmai.", "micontraseña"); >> smtpcliente.Port = 587; >> smtpcliente.Host = "smtp.gmail.com"; >> >> smtpcliente.EnableSsl = true; >> try { >> smtpcliente.Send(Mensaje); >> >> System.Console.WriteLine("mensaje >> enviado"); >> >> } catch (System.Net.Mail.SmtpException e) { >> System.Console.WriteLine(e); >> } >> } >> } > > > -- > Atte, > Juan Cristóbal Olivares > חואנכרי > > ============== > > Renovarse o morir: Mi PC de los sesenta tenía veinte mil militantes. Y mi PC > del siglo XXI tiene cuarenta gigabytes. > _______________________________________________ Mono-hispano mailing list [email protected] https://listas.hispalinux.es/mailman/listinfo/mono-hispano