diff --git a/core/src/main/java/hudson/tasks/Mailer.java b/core/src/main/java/hudson/tasks/Mailer.java index 7345115d26ab9def368458261a957872ca9c7095..a892a9042b3c2539e0eb4e68540f635e106459a8 100644 --- a/core/src/main/java/hudson/tasks/Mailer.java +++ b/core/src/main/java/hudson/tasks/Mailer.java @@ -441,14 +441,14 @@ public class Mailer extends Notifier { public FormValidation doSendTestMail( @QueryParameter String smtpServer, @QueryParameter String adminAddress, @QueryParameter boolean useSMTPAuth, @QueryParameter String smtpAuthUserName, @QueryParameter String smtpAuthPassword, - @QueryParameter boolean useSsl, @QueryParameter String smtpPort, + @QueryParameter boolean useSsl, @QueryParameter String smtpPort, @QueryParameter String charset, @QueryParameter String sendTestMailTo) throws IOException, ServletException, InterruptedException { try { if (!useSMTPAuth) smtpAuthUserName = smtpAuthPassword = null; MimeMessage msg = new MimeMessage(createSession(smtpServer,smtpPort,useSsl,smtpAuthUserName,Secret.fromString(smtpAuthPassword))); - msg.setSubject("Test email #" + ++testEmailCount); - msg.setContent("This is test email #" + testEmailCount + " sent from " + Jenkins.getInstance().getDisplayName(), "text/plain"); + msg.setSubject(Messages.Mailer_TestMail_Subject(++testEmailCount), charset); + msg.setText(Messages.Mailer_TestMail_Content(testEmailCount, Jenkins.getInstance().getDisplayName()), charset); msg.setFrom(new InternetAddress(adminAddress)); msg.setSentDate(new Date()); msg.setRecipient(Message.RecipientType.TO, new InternetAddress(sendTestMailTo)); diff --git a/core/src/main/resources/hudson/tasks/Messages.properties b/core/src/main/resources/hudson/tasks/Messages.properties index 73f3010372dde2fd914d9fb949a98e03cfdbb153..52344a9dad5b7e785913d2ab304d2be05eb53d36 100644 --- a/core/src/main/resources/hudson/tasks/Messages.properties +++ b/core/src/main/resources/hudson/tasks/Messages.properties @@ -93,6 +93,8 @@ Mailer.Localhost.Error=Please set a valid host name, instead of localhost Mailer.UserProperty.DisplayName=E-mail Mailer.EmailSentSuccessfully=Email was successfully sent Mailer.FailedToSendEmail=Failed to send out e-mail +Mailer.TestMail.Subject=Test email #{0} +Mailer.TestMail.Content=This is test email #{0} sent from {1} Maven.DisplayName=Invoke top-level Maven targets Maven.ExecFailed=command execution failed