.NET의 SmtpClient는 MIME 인코딩 된 줄의 시작 부분에 점이 표시되는 경우 호스트 이름에 추가 점이있는 이메일을 생성하는 것으로 보입니다 (예 : test.com이 때때로 test..com으로 표시됨). . 예제 코드 :
[TestMethod]
public void TestEmailIssue()
{
var mail = new System.Net.Mail.MailMessage();
var smtpClient = new System.Net.Mail.SmtpClient();
mail.To.Add("Test@test.com");
mail.Subject = "Test";
mail.From = new System.Net.Mail.MailAddress("test@test.com");
mail.Body = "Hello this is a short test of the issue:"
+" https://test.com/: ";
smtpClient.PickupDirectoryLocation = "C:\\temp\\";
smtpClient.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.SpecifiedPickupDirectory;
smtpClient.Send(mail);
}
다음과 같은 .eml 파일이 생성됩니다.
X-Sender : (hidden) (hidden) 1.0
From : (hidden) (hidden) 6 Jul 2011 15:55:28 -0400
Subject : 테스트
Content-Type : text / plain; charset = us-ascii
Content-Transfer-Encoding : quoted-printable
안녕하세요, 문제에 대한 간단한 테스트입니다. https : // test =
..com / '> https : //test.com/:=20
파일을 보내거나 Outlook (또는 다른 프로그램)에서 열 때 이중 점이 표시됩니다 (예 : test..com). 추가 공백 ( "is a")을 제거하면 해당 줄의 시작 부분에 점이 더 이상 나타나지 않으므로 test.com이 올바르게 표시됩니다.
이로 인해 웹 사이트 주소를 보내려고 할 때 문제가 발생합니다. 고객으로부터 링크를 클릭 할 수 없다는 전화를받습니다.
다른 사람이 이것을 경험 한 적이 있습니까? 자체 인코딩을 작성하는 것 외에이 문제를 어떻게 해결할 수 있습니까?