IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

API standards et tierces Java Discussion :

Envoyer un courriel GMail - application web


Sujet :

API standards et tierces Java

  1. #1
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut Envoyer un courriel GMail - application web
    Bonjour,

    Je tente d'envoyer un email mais j'obtiens une exception.

    Je ne vois pas la différence entre envoyer un mail de Outlook (par exemple au travail) et envoyer un message d'un PC privé (chez moi) en utilisant la même classe ?

    Voici ma classe:
    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
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    package jMail;
     
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
     
    public class Mail {
        private String to;
        private String from;
        private String message;
        private String subject;
        private String smtpServ;
     
        /**
         * @return the to
         */
        public String getTo() {
            return to;
        }
     
        /**
         * @param to the to to set
         */
        public void setTo(String to) {
            this.to = to;
        }
     
        /**
         * @return the from
         */
        public String getFrom() {
            return from;
        }
     
        /**
         * @param from the from to set
         */
        public void setFrom(String from) {
            this.from = from;
        }
     
        /**
         * @return the message
         */
        public String getMessage() {
            return message;
        }
     
        /**
         * @param message the message to set
         */
        public void setMessage(String message) {
            this.message = message;
        }
     
        /**
         * @return the subject
         */
        public String getSubject() {
            return subject;
        }
     
        /**
         * @param subject the subject to set
         */
        public void setSubject(String subject) {
            this.subject = subject;
        }
     
        /**
         * @return the smtpServ
         */
        public String getSmtpServ() {
            return smtpServ;
        }
     
        /**
         * @param smtpServ the smtpServ to set
         */
        public void setSmtpServ(String smtpServ) {
            this.smtpServ = smtpServ;
        }
     
        public int sendMail(){
            try
            {
                Properties props = System.getProperties();
                // -- Attaching to default Session, or we could start a new one --
                props.put("mail.transport.protocol", "smtp" );
                props.put("mail.smtp.starttls.enable","true" );
                props.put("mail.smtp.host",smtpServ);
                props.put("mail.smtp.auth", "true" );
                Authenticator auth = new SMTPAuthenticator();
                Session session = Session.getInstance(props, auth);
                // -- Create a new message --
                Message msg = new MimeMessage(session);
                // -- Set the FROM and TO fields --
                msg.setFrom(new InternetAddress(from));
                msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                msg.setSubject(subject);
                msg.setText(message);
                // -- Set some other header information --
                msg.setHeader("MyMail", "Mr. XYZ" );
                msg.setSentDate(new Date());
                // -- Send the message --
                Transport.send(msg);
                System.out.println("Message sent to"+to+" OK." );
                return 0;
            }
            catch (Exception ex)
            {
                System.out.println("Exception "+ex);
                return -1;
            }
       }
     
       // Also include an inner class that is used for authentication purposes
     
       private class SMTPAuthenticator extends javax.mail.Authenticator {
           @Override
           public PasswordAuthentication getPasswordAuthentication() {
               String username =  "myEmail@";          
               String password = "myPassword";                                     
               return new PasswordAuthentication(username, password);
           }
       }
    }
    L'exception :
    INFO: Exception javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25;
    nested exception is:
    java.net.ConnectException: Connection refused: connect
    INFO: WEB0671: Loading application [JavaMail] at [/JavaMail]
    INFO: JavaMail was successfully deployed in 266 milliseconds.
    INFO: Exception javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25;
    nested exception is:
    java.net.ConnectException: Connection refused: connect
    INFO: The Admin Console is already installed, but not yet loaded.
    INFO: The Admin Console is starting. Please wait.
    INFO: Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context ''
    INFO: Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false
    INFO: Initiating Jersey application, version 'Jersey: 1.11 12/09/2011 10:27 AM'
    INFO: WEB0671: Loading application [__admingui] at [/]
    INFO: CORE10010: Loading application __admingui done in 5,343 ms
    INFO: The Admin Console application is loaded.
    INFO: REST00001: Listening to REST requests at context: /management/domain
    WARNING: PWC4011: Unable to set request character encoding to UTF-8 from context , because request parameters have already been read, or ServletRequest.getReader() has already been called
    INFO: Redirecting to /login.jsf
    INFO: Admin Console: Initializing Session Attributes...
    Quelqu'un saurait-il m'indiquer comment résoudre ce problème ?

    Merci d'avance pour votre aide.

  2. #2
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 075
    Points : 7 981
    Points
    7 981
    Par défaut
    La tu essayes de te connecter au port smtp par defaut (25).
    Mais gmail requiert aussi d'autres paramètres.

    Regarde ceci : http://www.developpez.net/forums/d83...mail-via-smtp/ ou http://www.developpez.net/forums/d70...ication-gmail/
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  3. #3
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 552
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 552
    Points : 21 608
    Points
    21 608
    Par défaut
    Citation Envoyé par machipot Voir le message
    Je ne vois pas la différence entre envoyer un mail de Outlook (par exemple au travail) et envoyer un message d'un PC privé (chez moi) en utilisant la même classe ?
    Ton FAI bloque le port 25 vers les SMTP autres que celui qu'il te propose. Ceci est une mesure pour ne pas permettre les internautes de spammer ou autres nuisances directement.

    Ton réseau d'entreprise ne fait rien de ce genre, probablement parce qu'il a besoin lui-même de se connecter à divers SMTP.
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Citation Envoyé par thelvin Voir le message
    Ton FAI bloque le port 25 vers les SMTP
    C'est surtout que gmail n'écoute pas sur le port 25 mais sur le port 465.

  5. #5
    Modérateur

    Profil pro
    Inscrit en
    Septembre 2004
    Messages
    12 552
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2004
    Messages : 12 552
    Points : 21 608
    Points
    21 608
    Par défaut
    Du coup je vois pas pourquoi il nous parle d'envoyer un mail du boulot ou de chez lui "avec la même classe."
    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  6. #6
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut
    Merci tous a vos reponses,

    ce que je ne comprends pas, c'est pourquoi on utilise des ports diffrents, 25,465, 587....comment savoir le bon port?
    j'espere que vous comprenez que je suis nouveau dans le domaine.

    merci encore

  7. #7
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 075
    Points : 7 981
    Points
    7 981
    Par défaut
    Voici un petit résumé des port et de leur "utilité" (si je puis dire cela).

    25 : sans authentification
    587 : avec authentification
    465 : SSL

    (source wikipedia)

    Alors ensuite pour savoir quel port il faut utiliser, tu ne saurais évidement pas le deviner, sauf en te renseignant, soit en testant "a la main" avec un client mail ou telnet au pire...
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  8. #8
    Membre émérite
    Avatar de olivier.pitton
    Homme Profil pro
    Développeur Java
    Inscrit en
    Juin 2012
    Messages
    355
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 35
    Localisation : France, Hauts de Seine (Île de France)

    Informations professionnelles :
    Activité : Développeur Java
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2012
    Messages : 355
    Points : 2 814
    Points
    2 814
    Par défaut
    Tous les ports sous 1024 sont "réservés" pour des protocoles / applications standards. SSH, Telnet, FTP, HTTP, ...

    Comme dit précédemment, le port utilisé par GMail est 465 car il n'utilise pas le protocole SMTP mais SMTPS (si je ne dis pas de bêtises, vu que 465 est SMTPS), qui est une version sécurisée de SMTP.

  9. #9
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut
    ça fait 2 jours que j'essaye de faire fonctionner cette class.
    j'ai essayé tous les port, 25, 587, 465
    en ajoutant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    props.put("mail.smtp.port",587);
    je reçoi toujours l'exeption:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    INFO: Exception javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 587;
      nested exception is:
    	java.net.ConnectException: Connection refused: connect ------ smtp.gmail.com

  10. #10
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Donne nou déjà tout ton code (pas juste le port) avec le message que tu obtiens, avec le bon port (465)

  11. #11
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut
    voici tous le code de ma class:
    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
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package jMail;
     
    import java.util.Date;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.InternetAddress;
    import javax.mail.internet.MimeMessage;
     
     
    /**
     *
     * 
     */
    public class Mail {
        private String to;
        private String from;
        private String message;
        private String subject;
        private String smtpServ;
     
        /**
         * @return the to
         */
        public String getTo() {
            return to;
        }
     
        /**
         * @param to the to to set
         */
        public void setTo(String to) {
            this.to = to;
        }
     
        /**
         * @return the from
         */
        public String getFrom() {
            return from;
        }
     
        /**
         * @param from the from to set
         */
        public void setFrom(String from) {
            this.from = from;
        }
     
        /**
         * @return the message
         */
        public String getMessage() {
            return message;
        }
     
        /**
         * @param message the message to set
         */
        public void setMessage(String message) {
            this.message = message;
        }
     
        /**
         * @return the subject
         */
        public String getSubject() {
            return subject;
        }
     
        /**
         * @param subject the subject to set
         */
        public void setSubject(String subject) {
            this.subject = subject;
        }
     
        /**
         * @return the smtpServ
         */
        public String getSmtpServ() {
            return smtpServ;
        }
     
        /**
         * @param smtpServ the smtpServ to set
         */
        public void setSmtpServ(String smtpServ) {
            this.smtpServ = smtpServ;
        }
     
     
     
        public int sendMail(){
            try
            {
     
                Properties props = System.getProperties();
                  // -- Attaching to default Session, or we could start a new one --
                  props.put("mail.transport.protocol", "smtp" );
                  props.put("mail.smtp.starttls.enable","true" );
                  props.put("mail.smtp.host",smtpServ);
                  props.put("mail.smtp.auth", "true" );
                props.put("mail.smtp.port",465);
     
                  Authenticator auth = new SMTPAuthenticator();
                  Session session = Session.getInstance(props, auth);
     
                  // -- Create a new message --
                  Message msg = new MimeMessage(session);
                  // -- Set the FROM and TO fields --
                  msg.setFrom(new InternetAddress(from));
                  msg.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                  msg.setSubject(subject);
                  msg.setText(message);
                  // -- Set some other header information --
                  msg.setHeader("MyMail", "Mr. XYZ" );
                  msg.setSentDate(new Date());
                  // -- Send the message --
                  Transport.send(msg);
                  System.out.println("Message sent to"+to+" OK." );
                  return 0;
            }
            catch (Exception ex)
            {
              System.out.println("Exception "+ex + " ------ " + getSmtpServ() );
              return -1;
            }
     
      }
     
    // Also include an inner class that is used for authentication purposes
     
    private class SMTPAuthenticator extends javax.mail.Authenticator {
            @Override
            public PasswordAuthentication getPasswordAuthentication() {
                String username =  "monEmailOutlook@gc.ca";           // specify your email id here (sender's email id)
                String password = "monPasswordOutlook";                                      // specify your password here
                return new PasswordAuthentication(username, password);
            }
      }
     
     
     
     
    }
    et l'erreur:
    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
    Launching GlassFish on Felix platform
    INFO: Running GlassFish Version: GlassFish Server Open Source Edition 3.1.2 (build 23)
    INFO: Grizzly Framework 1.9.46 started in: 31ms - bound to [0.0.0.0:3700]
    INFO: Grizzly Framework 1.9.46 started in: 15ms - bound to [0.0.0.0:7676]
    INFO: Grizzly Framework 1.9.46 started in: 47ms - bound to [0.0.0.0:4848]
    INFO: Grizzly Framework 1.9.46 started in: 47ms - bound to [0.0.0.0:8181]
    INFO: Grizzly Framework 1.9.46 started in: 62ms - bound to [0.0.0.0:8080]
    INFO: The Admin Console is already installed, but not yet loaded.
    INFO: Registered org.glassfish.ha.store.adapter.cache.ShoalBackingStoreProxy for persistence-type = replicated in BackingStoreFactoryRegistry
    INFO: SEC1002: Security Manager is OFF.
    INFO: SEC1010: Entering Security Startup Service
    INFO: SEC1143: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
    INFO: SEC1115: Realm [admin-realm] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
    INFO: SEC1115: Realm [file] of classtype [com.sun.enterprise.security.auth.realm.file.FileRealm] successfully created.
    INFO: SEC1115: Realm [certificate] of classtype [com.sun.enterprise.security.auth.realm.certificate.CertificateRealm] successfully created.
    INFO: SEC1011: Security Service(s) Started Successfully
    INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
    INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
    INFO: WEB0169: Created HTTP listener [admin-listener] on host/port [0.0.0.0:4848]
    INFO: WEB0171: Created virtual server [server]
    INFO: WEB0171: Created virtual server [__asadmin]
    INFO: WEB0172: Virtual server [server] loaded default web module []
    INFO: WEB0671: Loading application [LeaveRequest] at [/LeaveRequest]
    INFO: CORE10010: Loading application LeaveRequest done in 3,532 ms
    INFO: WEB0671: Loading application [JavaMail] at [/JavaMail]
    INFO: CORE10010: Loading application JavaMail done in 203 ms
    INFO: GlassFish Server Open Source Edition 3.1.2 (23) startup time : Felix (2,985ms), startup services(4,797ms), total(7,782ms)
    INFO: Hibernate Validator 4.2.0.Final
    INFO: JMX005: JMXStartupService had Started JMXConnector on JMXService URL service:jmx:rmi://NCA8022711E.CIPS.COMMUNICATION.GC.CA:8686/jndi/rmi://NCA8022711E.CIPS.COMMUNICATION.GC.CA:8686/jmxrmi
    INFO: WEB0169: Created HTTP listener [http-listener-1] on host/port [0.0.0.0:8080]
    INFO: Grizzly Framework 1.9.46 started in: 0ms - bound to [0.0.0.0:8080]
    INFO: WEB0169: Created HTTP listener [http-listener-2] on host/port [0.0.0.0:8181]
    INFO: Grizzly Framework 1.9.46 started in: 16ms - bound to [0.0.0.0:8181]
    INFO: Created EjbThreadPoolExecutor with thread-core-pool-size 16 thread-max-pool-size 32 thread-keep-alive-seconds 60 thread-queue-capacity 2147483647 allow-core-thread-timeout false 
    INFO: Initiating Jersey application, version 'Jersey: 1.11 12/09/2011 10:27 AM'
    INFO: REST00001: Listening to REST requests at context: /management/domain
    INFO: The Admin Console is already installed, but not yet loaded.
    INFO: The Admin Console is starting. Please wait.
    INFO: Initializing Mojarra 2.1.6 (SNAPSHOT 20111206) for context ''
    INFO: WEB0671: Loading application [__admingui] at [/]
    INFO: CORE10010: Loading application __admingui done in 4,140 ms
    INFO: The Admin Console application is loaded.
    INFO: Exception javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465;
      nested exception is:
    	java.net.ConnectException: Connection timed out: connect ------ smtp.gmail.com

  12. #12
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 075
    Points : 7 981
    Points
    7 981
    Par défaut
    Il est fort probable que le port soit bloqué de ton coté (pas du coté gmail en tout cas ^^). Je te confirme que de mon coté ou rien n'est bloqué les port 465 et 587 répondent bien.

    Si tu veux être sure que tu peux te connecter et que l'erreur vient pas de java par exemple, tu peux vérifier ainsi en ligne de commande :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    telnet smtp.gmail.com 587
    Tu devrais avoir directement l'effacement de l'ecran suivi d'un truc genre :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    220 mx.google.com ESMTP x10sm2175416bkv.13
    helo
    250 mx.google.com at your service
    quit
    Sinon tu verras un joli (après moultes secondes) :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Connexion à smtp.gmail.com...Impossible d'ouvrir une connexion à l'hôte, sur le
    port 586: Échec lors de la connexion
    Comme ca tu seras au moins fixé sur une chose.
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  13. #13
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut
    wax78,
    Effectivement ça me donne:
    Connexion à smtp.gmail.com...Impossible d'ouvrir une connexion à l'hôte, sur le
    port 465: Échec lors de la connexion

  14. #14
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 075
    Points : 7 981
    Points
    7 981
    Par défaut
    Ok, donc ce que disais le programme java était bon (connection timeout).

    Donc maintenant restes a trouver si la ou tu te trouve (fai) tu peux ou pas débloquer le port.
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  15. #15
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut
    Puis-je le faire a mon niveau ?
    Ou demander au gestionnaire du serveur...

  16. #16
    Modérateur
    Avatar de wax78
    Homme Profil pro
    Chef programmeur
    Inscrit en
    Août 2006
    Messages
    4 075
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 43
    Localisation : Belgique

    Informations professionnelles :
    Activité : Chef programmeur
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Août 2006
    Messages : 4 075
    Points : 7 981
    Points
    7 981
    Par défaut
    A moins que ca soit ton firewall ou ton ordi, il y a des chances qu'il faut que tu poses la question oui (d'ailleurs ta question l'indique intrinsèquement
    (Les "ça ne marche pas", même écrits sans faute(s), vous porteront discrédit ad vitam æternam et malheur pendant 7 ans)

    N'oubliez pas de consulter les FAQ Java et les cours et tutoriels Java

  17. #17
    Membre régulier
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    200
    Détails du profil
    Informations personnelles :
    Localisation : Belgique

    Informations forums :
    Inscription : Septembre 2006
    Messages : 200
    Points : 73
    Points
    73
    Par défaut
    J’ai désactivé le firewall de mon ordi et le problème persiste toujours!!!!

Discussions similaires

  1. Envoyer des courriels avec une application iPhone
    Par Community Management dans le forum Développement iOS
    Réponses: 0
    Dernier message: 24/07/2014, 15h14
  2. Réponses: 1
    Dernier message: 15/08/2013, 13h42
  3. Réponses: 1
    Dernier message: 04/12/2012, 09h30
  4. envoyer une requéte a une autre application web
    Par open_source dans le forum Général Java
    Réponses: 4
    Dernier message: 02/01/2009, 19h49

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo