to = t;
code = c;
}
public void run() {
MailEngine sender = new MailEngine();
sender.setMxConfig(new MxConfig());
// Create a new Mail:
Mail mail = null;
try {
mail = Mail.buildTextMail(
"services-no-reply@gamesnet.net",
to,
"Welcome to GamesNET",
util.readFileAsString("register.txt").replace("%%CODE%%", code));
sender.send(mail, new MailListenerAdapter()); // send it!
} catch (IOException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
}