状況に遭遇しました。メールの件名が80文字以上のメールを送信すると、メールの件名に「タブ」の文字が挿入されることがあります。無効な電子メールのメールヘッダーをチェックし、80文字以上のメールヘッダエントリがある場合は整列し、新しい行に折り返して 'タブ'を挿入します。どのような設定を制御するか分からない、javaMailの設定? SMTPの設定?メールヘッダーのアラインメントを制御する方法は?
サンプルヘッダ:
ケース1:invaild電子メールの件名には、文字 'タブ' を挿入します。
Received: from as09.aaaaaaaaa.com ([192.168.1.129]) by aaaaaaaaa.com
([192.168.1.49]) with ESMTP (TREND IMSS SMTP Service 7.0; TLS:
TLSv1/SSLv3,168bits,DES-CBC3-SHA) id ba8afe04001a23ba ; Wed, 1 Feb 2012
16:17:10 +0800
Received: from as09 (localhost [127.0.0.1])by as09.aaaaaaaaa.com
(8.13.8+Sun/8.13.8) with ESMTP id q118HAgi021891;Wed, 1 Feb 2012 16:17:10
+0800 (HKT)
Message-ID: <[email protected]>
Date: Wed, 1 Feb 2012 08:17:10 +0000
From: <[email protected]>
To: [email protected],
[email protected],
[email protected]
Subject: test Daily report for city pairs of iPhone App enquiries indocument
version Demo Customer/Test/Test/123/1231
CC: [email protected]
MIME-Version: 1.0
ケース2:有効な電子メールの件名は、単に
Received: from as08.aaaaaaaaa.com ([192.168.1.104]) by aaaaaaaaa.com
([192.168.1.49]) with ESMTP (TREND IMSS SMTP Service 7.0; TLS:
TLSv1/SSLv3,168bits,DES-CBC3-SHA) id c356e969001b37a5 ; Fri, 3 Feb 2012
09:16:58 +0800
Received: from as08.aaaaaaaaa.com (localhost [127.0.0.1]) by
as08.aaaaaaaaa.com (8.13.4+Sun/8.13.4) with ESMTP id q131Gw1l006160; Fri, 3
Feb 2012 09:16:58 +0800 (HKT)
Message-ID: <[email protected]>
Date: Fri, 3 Feb 2012 01:16:58 +0000
From: <[email protected]>
To: [email protected]
Subject: test Daily report for city pairs of iPhone App enquiries in
document version Demo Customer/Test/Test/123/1231
CC: [email protected]
を包んサンプルJavaコード:
public void sendEmail(Request req) throws Exception {
Session mailSession;
MimeMessage msg;
Properties mailSessionProp = new Properties();
mailSessionProp.put("mail.smtp.host", "localhost");
mailSessionProp.put("mail.smtp.port", "25");
mailSession = Session.getInstance(mailSessionProp, null);
msg = new MimeMessage(mailSession);
msg.addRecipients("TO", InternetAddress.parse(req.getRecipientAddress()));
msg.setSubject(MimeUtility.encodeText(req.getSubject(), "UTF-8", "B"));
msg.setHeader("X-Mailer", "");
msg.setSentDate(new Date());
msg.setContent(req.getMessage(), req.getMessageContentType().getType());
Transport.send(msg);
}
のJavaMail:あなた
Manifest-Version: 1.0
Implementation-Version: 1.3.3_01
Specification-Title: JavaMail(TM) API Design Specification
Specification-Version: 1.3
Extension-Name: javax.mail
Created-By: 1.3.1 (Sun Microsystems Inc.)
Implementation-Vendor-Id: com.sun
Implementation-Vendor: Sun Microsystems, Inc.
Specification-Vendor: Sun Microsystems, Inc.
SCCS-ID: @(#)javamail.mf 1.5 02/03/14
[メール] 425 –