1
После многочисленных исследований я не могу добиться успеха, чтобы отправить почту с ЯвойJava: Отправка неудачен
Properties props = new Properties();
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.starttls.required", "true");
props.put("mail.transport.protocol","smtp");
props.put("mail.smtp.host", "smtp.live.com");
props.put("mail.smtp.port", "587");
Session session = Session.getDefaultInstance(props, null);
Message msg = new MimeMessage(session);
msg.setFrom(new InternetAddress("[email protected]"));
InternetAddress toAddress = new InternetAddress("[email protected]");
msg.addRecipient(Message.RecipientType.TO, toAddress);
msg.setSubject("sujet du mail de text");
msg.setText("aaa");
Transport transport = session.getTransport("smtps");
transport.connect("smtp.gmail.com", 587,"[email protected]", "mypasswordcached");
transport.send(msg);
У меня есть исключение в потоке «основной» javax.mail.NoSuchProviderException: Нет провайдер для SMTPS Я не» t понять почему Кто-нибудь может мне помочь?
Это выглядит примерно http://stackoverflow.com/questions/4457731/error-in-sending-mail-through- smtps надеются, что это поможет. – Steve