SpringMail使用过程中的报错

1、Unable to locate provider for protocol: smtp –>缺少依赖造成的

<dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.0.2</version>
    </dependency>

2、501 mail from address must be same as authorization user –>这是因为没有设置邮件发送者,发送邮件必须要有发送者的:

mailMsg.setFrom("1573876303@qq.com");

3、javax.mail.AuthenticationFailedException –>设置没有问题的话,绝对是账户密码出错的问题

你可能感兴趣的:(邮件,mail,springmail)