MailAPI
配置文件:smtp服务器:#邮件服务器,如qq邮箱smtp服务器填"smtp.qq.com"
端口:#邮件服务端口,如qq邮箱填"465"
邮箱地址:#开通smtp服务的邮箱,如qq邮箱填"[email protected]"
邮箱密码:#上面邮箱的smtp服务密码,qq邮箱->设置->账户,如下图
new MailAPI();#使用配置文件
new MailAPI(String server, String port, String ssl, String mail, String password);#新指定服务器
sendTextOnlyMail(String sendTo,String title,String text);#发送纯文字邮件 sendTo:收件人地址;title:标题;text:内容
sendTextAndFileMail(String sendTo,String title,String text,String filePath)#发送文字与附件邮件 filePath文件路径
以上text均可使用HTML
verifyCode();#生成随机的6位字母与数字,可用作验证码
例:
new MailAPI().sendTextOnlyMail("[email protected]","验证码","<h1> 验证码 </h1>\n<p>绑定验证码</p>\n" + MailAPI.verifyCode());
by.殇丶歆