L'envoi de mails via Spring boot “printemps-amorçage-starter-mail”

Je suis en train d'envoyer des e-mails à l'aide de spring boot, mais je suis arriver:

java.lang.UnsupportedOperationException: Method not yet implemented
        at javax.mail.internet.MimeMessage.<init>(MimeMessage.java:89)
        at org.springframework.mail.javamail.SmartMimeMessage.<init>(SmartMimeMessage.java:52)
        at org.springframework.mail.javamail.JavaMailSenderImpl.createMimeMessage(JavaMailSenderImpl.java:325)

J'ai utilisé cette maven entrée:

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.2.6.RELEASE</version>
    </parent>

<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>1.2.6.RELEASE</version>
        </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
        <version>1.2.6.RELEASE</version>
    </dependency>

application.propriétés:

spring.mail.host=smtp.gmail.com
spring.mail.port= 25
spring.mail.username= test
spring.mail.password= test

Et Mon code:

@Autowired
    private JavaMailSender javaMailSender;

private void send() {
        MimeMessage mail = javaMailSender.createMimeMessage();
        try {
            MimeMessageHelper helper = new MimeMessageHelper(mail, true);
            helper.setTo("[email protected]");
            helper.setReplyTo("[email protected]");
            helper.setFrom("[email protected]");
            helper.setSubject("Lorem ipsum");
            helper.setText("Lorem ipsum dolor sit amet [...]");
        } catch (MessagingException e) {
            e.printStackTrace();
        } finally {}
        javaMailSender.send(mail);
        //return helper;
    }

Ce qui semble être tout droit vers l'avant, mais ne faites pas ce qui me manque!

InformationsquelleAutor krmanish007 | 2015-10-19