mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-09-16 17:04:40 +02:00
commit
1fcf019b2b
14
pom.xml
14
pom.xml
@ -203,14 +203,14 @@
|
|||||||
|
|
||||||
<!-- Multi World plugin, http://www.spigotmc.org/resources/multiverse-core.390/ -->
|
<!-- Multi World plugin, http://www.spigotmc.org/resources/multiverse-core.390/ -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.onarandombox.multiversecore</groupId>
|
<groupId>com.onarandombox.multiversecore</groupId>
|
||||||
<artifactId>Multiverse-Core</artifactId>
|
<artifactId>Multiverse-Core</artifactId>
|
||||||
<version>2.5</version>
|
<version>2.5</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Essentials plugin-->
|
<!-- Essentials plugin -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.ess3</groupId>
|
<groupId>net.ess3</groupId>
|
||||||
<artifactId>Essentials</artifactId>
|
<artifactId>Essentials</artifactId>
|
||||||
|
@ -3,8 +3,8 @@ package fr.xephi.authme;
|
|||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import javax.mail.Message;
|
import javax.mail.Message;
|
||||||
import javax.mail.MessagingException;
|
|
||||||
import javax.mail.PasswordAuthentication;
|
import javax.mail.PasswordAuthentication;
|
||||||
import javax.mail.Session;
|
import javax.mail.Session;
|
||||||
import javax.mail.Transport;
|
import javax.mail.Transport;
|
||||||
@ -44,13 +44,13 @@ public class SendMailSSL {
|
|||||||
props.put("mail.smtp.auth", "true");
|
props.put("mail.smtp.auth", "true");
|
||||||
props.put("mail.smtp.port", String.valueOf(Settings.getMailPort));
|
props.put("mail.smtp.port", String.valueOf(Settings.getMailPort));
|
||||||
|
|
||||||
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
|
|
||||||
protected PasswordAuthentication getPasswordAuthentication() {
|
|
||||||
return new PasswordAuthentication(Settings.getmailAccount, Settings.getmailPassword);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Session session = Session.getInstance(props, new javax.mail.Authenticator() {
|
||||||
|
|
||||||
|
protected PasswordAuthentication getPasswordAuthentication() {
|
||||||
|
return new PasswordAuthentication(Settings.getmailAccount, Settings.getmailPassword);
|
||||||
|
}
|
||||||
|
});
|
||||||
final Message message = new MimeMessage(session);
|
final Message message = new MimeMessage(session);
|
||||||
try {
|
try {
|
||||||
message.setFrom(new InternetAddress(Settings.getmailAccount, sendername));
|
message.setFrom(new InternetAddress(Settings.getmailAccount, sendername));
|
||||||
@ -66,19 +66,20 @@ public class SendMailSSL {
|
|||||||
text = text.replace("<generatedpass>", newPass);
|
text = text.replace("<generatedpass>", newPass);
|
||||||
message.setContent(text, "text/html");
|
message.setContent(text, "text/html");
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
Transport.send(message);
|
Transport.send(message);
|
||||||
} catch (MessagingException e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
ConsoleLogger.showError("Some error appears while trying to send mail to " + auth.getEmail());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (!Settings.noConsoleSpam)
|
if (!Settings.noConsoleSpam)
|
||||||
ConsoleLogger.info("Email sent to : " + auth.getNickname());
|
ConsoleLogger.info("Email sent to : " + auth.getNickname());
|
||||||
} catch (MessagingException e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
ConsoleLogger.showError("Some error appears while trying to send mail to " + auth.getEmail());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user