<small id='kwpKL'></small> <noframes id='ElJ0g9S'>

  • <tfoot id='7LHs2R'></tfoot>

      <legend id='TFqr'><style id='edY8'><dir id='f6t2TRlYo'><q id='soPLpbI'></q></dir></style></legend>
      <i id='1TONZ4G7'><tr id='6LKJ83tZd7'><dt id='BH2Q1qN9F'><q id='dw56'><span id='0FjWJC'><b id='uPJ5'><form id='lEJow'><ins id='3v26yoMAI8'></ins><ul id='9NpnEHvIm'></ul><sub id='e4yXdPl'></sub></form><legend id='yb7uG1eDTo'></legend><bdo id='qoWYp4jGc'><pre id='nBbur9v'><center id='neFcH1y'></center></pre></bdo></b><th id='REiCfQ'></th></span></q></dt></tr></i><div id='rTNp2ncSA'><tfoot id='TChm'></tfoot><dl id='dPlj'><fieldset id='uIzYJb'></fieldset></dl></div>

          <bdo id='MC4a'></bdo><ul id='gpWGrX'></ul>

          1. <li id='WS5c1'></li>
            登陆

            一号平台vip-运用SpringBoot 发送简略邮件

            admin 2019-07-11 176人围观 ,发现0个评论

            1.一号平台vip-运用SpringBoot 发送简略邮件 在pom.xml中导入依靠



            org.springframework.boot
            spring-boot-starter-mail

            2. 装备application.properties文件

            在此咱们以QQ邮箱为例, 秘东临碣石以观沧海钥运用的是QQ邮箱POP3/SMTP服务供给的秘钥并不是登录暗码

            #发送邮件装备
            spring.mail.host=smtp.qq.com
            sp一号平台vip-运用SpringBoot 发送简略邮件ring.mail.username=QQ号码(邮件发送方)
            spring.mail.password=秘钥
            spring.mail.properties.mail.smtp.auth=true
            spring.mail.properties.mail.smtp.starttls.enable=true
            spring.mail.properties.mail.smtp.starttls.required=true

            3. 写一个测验类

            import javafx.application.Application;
            import org.junit.Test;
            import org.junit.runner.RunWith;
            import org.springframework.beans.factory.annotation.Autowired;
            import org.springframework.boot.test.context.SpringBootTest;
            import org.springframework.mail.SimpleMailMessage;
            import org.springframework.mail.javamail.JavaMailSender;
            import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
            @RunWith(SpringJUnit4ClassRunner.class)
            @SpringBootTest(classes = YisizhusystemApplication.class)
            public class ApplicationTests {
            @Autowired
            private JavaMailSender mailSender;
            @Test
            public void sendSimpleMail() throws Exception {
            SimpleMailMessage message = new Sim一号平台vip-运用SpringBoot 发送简略邮件pleMailMessage();
            message.setFrom("发送方@qq.com");
            message.setTo("接收方@163.com");
            message.setSubject("主题:简略邮件");
            message.setText("测验邮件内容");
            mailSender.send(message);
            }
            }

            QQ邮箱授权码获取办法

            请关注微信公众号
            微信二维码
            不容错过
            Powered By Z-BlogPHP