coinki
Messages postés57Date d'inscriptionmercredi 26 février 2003StatutMembreDernière intervention 6 juillet 2009
-
17 mai 2006 à 10:45
coinki
Messages postés57Date d'inscriptionmercredi 26 février 2003StatutMembreDernière intervention 6 juillet 2009
-
17 mai 2006 à 12:14
Salut,
J'ai un problème lorsque je souhaite envoyer un mail grâce aux lib System.Net.Mail.
J'utilise .Net 2.0 avec VS2005 Express.
Mon code :
MailAddress from = new MailAddress("moi@hotmail.fr");
MailAddress to = new MailAddress("dest@hotmail.fr");
coinki
Messages postés57Date d'inscriptionmercredi 26 février 2003StatutMembreDernière intervention 6 juillet 2009 17 mai 2006 à 11:59
Merci pour vos réponses... mais le firewall est désactivé et rien n'y fait !!
L'exception exacte est :
System.Net.Mail.SmtpException: Échec d'envoi du courrier. ---> System.Net.WebException: Impossible de se connecter au serveur distant ---> System.Net.Sockets.SocketException: Une connexion établie a été abandonnée par un logiciel de votre ordinateur hôte
à System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
à System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
à System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
--- Fin de la trace de la pile d'exception interne ---
à System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout)
à System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback)
à System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback)
à System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout)
à System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
à System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
à System.Net.Mail.SmtpClient.GetConnection()
à System.Net.Mail.SmtpClient.Send(MailMessage message)
--- Fin de la trace de la pile d'exception interne ---
à System.Net.Mail.SmtpClient.Send(MailMessage message)
à TestMail.Form1.button1_Click(Object sender, EventArgs e) dans C:\Documents and Settings\alain\Mes documents\Visual Studio 2005\Projects\TestMail\TestMail\Form1.cs:ligne 50