//发送激活邮件
Properties prop = new Properties()
prop.setProperty("mail.transport.protocol", "smtp")
prop.setProperty("mail.smtp.host", "smtp.qq.com")
prop.setProperty("mail.smtp.auth", "true")
prop.setProperty("mail.debug", "true")
//腾讯邮箱需要下面3个代码开启ssl 安全认证
prop.setProperty("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory")
prop.setProperty("mail.smtp.port", "465")
prop.setProperty("mail.smtp.socketFactory.port", "465")
Session session = Session.getInstance(prop)
Message msg = new MimeMessage(session)
msg.setFrom(new InternetAddress("974600840@qq.com"))
msg.setRecipient(MimeMessage.RecipientType.TO, new InternetAddress("这里填写收信人邮箱")
msg.setSubject("邮件标题")
msg.setText("邮件主题内容")
Transport tran = session.getTransport()
tran.connect("974600840@qq.com", "mgumxnxhsojhbegg")
tran.sendMessage(msg, msg.getAllRecipients())