Slt a tous
J'essaye d'envoyer un mail via une application Java alors j'ai télécharge le API JavaMail mais j'ai quelque probleme voici le code que j'utilise

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
 
public class SendMail {
 
    public static void main(String args[]) throws Exception {
 
        String host = "192.168.10.205";
        String from = "test@localhost";
        String to = "test@localhost";
 
        // Get system properties
        Properties properties = System.getProperties();
 
        // Setup mail server
        properties.setProperty("mail.smtp.host", host);
 
        // Get the default Session object.
        Session session = Session.getDefaultInstance(properties);
 
        // Create a default MimeMessage object.
        MimeMessage message = new MimeMessage(session);
 
        // Set the RFC 822 "From" header field using the
        // value of the InternetAddress.getLocalAddress method.
        message.setFrom(new InternetAddress(from));
 
        // Add the given addresses to the specified recipient type.
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
 
 
        // Set the "Subject" header field.
        message.setSubject("hi..!");
 
        // Sets the given String as this part's content,
        // with a MIME type of "text/plain".
        message.setText("Hi ......");
 
        // Send message
        Transport.send(message);
 
        System.out.println("Message Send.....");
    }
}
et voici les eurreurs
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
at java.net.Socket.connect(Socket.java:469)
	at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:233)
	at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:189)
	at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1359)
	... 7 more
Merci