Télécharger le zip
je suis pas sur mais y manque des trucs dans le zip? ya ke le fichier mail.jar...
faut l'ouvrir avec jar ou winrar et tu trouveras le contenu...B@ron {EU.BELGIUM}
dzl...je crois ke j'ai la strategie pour passer pour un con!merci encore pour ta disponnibilité! je crois ke ca va m'aider!bonne apmHermes(84)
Pas grave, voyons.Bon après-midi :pB@ron {EU.BELGIUM}
desolé mais je comprend pas comment ca fonctionne tu pourrais pas fournir un exemple avec, s'il te plait?merci
JE SAIS PLUS TROP SI C'EST CELA MAIS BON, J'ESPERE QUE CELA T'AIDERA... public static void main (String args[]){ try{ String host = "clinique-mail.stluc.ucl.ac.be"; String from = "thibaut.desany@clin.ucl.ac.be"; String to = "thibaut.desany@clin.ucl.ac.be"; String file = /*"C:\\myData\\newJDev\\jdev\\mywork\\JAVAFR\\MailMultipleParts\\*/"..\\textPart.txt"; // Get system properties Properties props = System.getProperties(); // Setup mail server props.put("mail.smtp.host", host); // Get session Session session = Session.getInstance(props, null); // Define message Message message = new MimeMessage(session); message.setFrom(new InternetAddress(from)); message.addRecipient(Message.RecipientType.TO, new InternetAddress(to)); message.setSubject("JavaMail avec un attachement"); // Create the message part BodyPart messageBodyPart = new MimeBodyPart(); // Fill the message messageBodyPart.setText("Voici le fichier"); // Create a Multipart Multipart multipart = new MimeMultipart(); // Add part one multipart.addBodyPart(messageBodyPart); // Part two is attachment // Create second body part messageBodyPart = new MimeBodyPart(); // Get the attachment DataSource source = new FileDataSource(file); // Set the data handler to the attachment messageBodyPart.setDataHandler(new DataHandler(source)); // Set the filename messageBodyPart.setFileName("textPart.txt"); // Add part two multipart.addBodyPart(messageBodyPart); // Put parts in message message.setContent(multipart); // Send the message Transport.send(message); }catch(Exception e){e.printStackTrace();}B@ron {EU.BELGIUM}
merci!j'ai trouver quelque chose qui peut être pas mal aussi, pas besoin de jar : http://www.rgagnon.com/javadetails/java-0083.htmlc pas mal pour envoyer des mails avec piece jointe
Se souvenir du profil
Mot de passe oublié ? / Activation de compteCréer un compte
1 871 792 membres 95 nouveaux aujourd'hui 16 146 membres club