<small id='eWaT3'></small> <noframes id='A3M8'>

  • <tfoot id='32rFAJV0I'></tfoot>

      <legend id='nQsLVa'><style id='fPDuO'><dir id='3mawY'><q id='13bCm5Fpiu'></q></dir></style></legend>
      <i id='oPNRCxWhj7'><tr id='bynZrUYe'><dt id='pF3y7'><q id='ncqa6t'><span id='EbFsB6V'><b id='DzQx6'><form id='7jI6JquokU'><ins id='Czbgme5OXw'></ins><ul id='aULd'></ul><sub id='7nUqx6a5s'></sub></form><legend id='9FUl'></legend><bdo id='QGAMk'><pre id='3YQVEhfk'><center id='Vb0X5G6AM'></center></pre></bdo></b><th id='8WLk4c'></th></span></q></dt></tr></i><div id='myefHF57lb'><tfoot id='Uckg'></tfoot><dl id='16708K4cX'><fieldset id='debKiARDf'></fieldset></dl></div>

          <bdo id='FsmB2'></bdo><ul id='wzdC7pWA'></ul>

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

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

            admin 2019-07-11 221人围观 ,发现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