提交 afe3a4c8 编写于 作者: S Seiji Sogabe

use charset for test e-mail. and i18n.

上级 14dee6e5
......@@ -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));
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册