All pastes #17308 Raw Edit

mail with c#

public text v1 · immutable
#17308 ·published 2005-07-09 11:55 UTC
rendered paste body
hello, I have a small problem. I want to send a mail in c# with mono, so I do that:
MailMessage mail = new MailMessage(); 
mail.To = "***@yahoo.fr"; 
mail.Subject = "ca marche";
mail.Body = "text";
mail.From = "***@yahoo.fr"; 
SmtpMail.SmtpServer = "smtp.neuf.fr"; 
SmtpMail.Send(mail);

my problem: it work only with smtp.neuf.fr who is the smtp of my ISP
for exemple, I can't use smtp.mail.yahoo.com
is there a way to do an authentification with a smtp server?