mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-25 01:57:48 +01:00
Fix attachment
This commit is contained in:
parent
a9a057c278
commit
46d39c7864
@ -53,11 +53,11 @@ public class SendMailSSL {
|
||||
email.addTo(mail);
|
||||
email.setFrom(acc, sender);
|
||||
email.setSubject(subject);
|
||||
email.setHtmlMsg(mailText);
|
||||
email.setAuthentication(acc, password);
|
||||
email.setStartTLSEnabled(true);
|
||||
email.setStartTLSRequired(true);
|
||||
email.setSSLCheckServerIdentity(true);
|
||||
String content = mailText;
|
||||
// Generate an image ?
|
||||
File file = null;
|
||||
if (Settings.generateImage) {
|
||||
@ -66,11 +66,13 @@ public class SendMailSSL {
|
||||
file = new File(plugin.getDataFolder() + File.separator + auth.getNickname() + "_new_pass.jpg");
|
||||
ImageIO.write(gen.generateImage(), "jpg", file);
|
||||
DataSource source = new FileDataSource(file);
|
||||
email.embed(source, auth.getNickname() + "_new_pass.jpg");
|
||||
String tag = email.embed(source, auth.getNickname() + "_new_pass.jpg");
|
||||
content = content.replace("<image>", "<img src=\"cid:" + tag + "\">");
|
||||
} catch (Exception e) {
|
||||
ConsoleLogger.showError("Unable to send new password as image! Using normal text! Dest: " + mail);
|
||||
}
|
||||
}
|
||||
email.setHtmlMsg(content);
|
||||
try {
|
||||
email.send();
|
||||
} catch (Exception e) {
|
||||
|
@ -340,7 +340,7 @@ Email:
|
||||
# Email subject of password get
|
||||
mailSubject: 'Your new AuthMe Password'
|
||||
# Email text here
|
||||
mailText: 'Dear <playername>, <br /><br /> This is your new AuthMe password for the server <br /><br /> <servername> : <br /><br /> <generatedpass><br /><br />Do not forget to change password after login! <br /> /changepassword <generatedpass> newPassword'
|
||||
mailText: 'Dear <playername>, <br /><br /> This is your new AuthMe password for the server <br /><br /> <servername> : <br /><br /> <generatedpass><br /><image><br />Do not forget to change password after login! <br /> /changepassword <generatedpass> newPassword'
|
||||
# Like maxRegPerIp but with email
|
||||
maxRegPerEmail: 1
|
||||
# Recall players to add an email ?
|
||||
|
Loading…
Reference in New Issue
Block a user