Open santosh103 opened 4 years ago
Do you have a sample of what you are doing and what is wrong ?
just add some custom header in the email and send it. Those custom headers are not visible in the mail received. For adding custom header I used - email.addHeaderLine("X_MY_Custom_Header=myValue");
Here what I used `
MimeMessage lMessage = new MimeMessage(session);
lMessage.setRecipient(Message.RecipientType.TO, new InternetAddress("user@example.org"));
lMessage.setSubject("Hello World!");
lMessage.setText("Hello World!");
lMessage.addHeaderLine("X_MY_Custom_Header=myValue");
//Send the mail via EWS
lTransport.sendMessage(lMessage, lMessage.getRecipients(Message.RecipientType.TO));
` And I got it in the email received :
Received: from servername.outlook.com ([xxxx::xxxx:xxxx:xxxx:xxxx]) by servername.outlook.com ([xxxx::xxxx:xxxx:xxxx:xxxx%6]) with mapi id xx.xx.xx.xx; Fri, 2 Oct 2020 17:12:40 +0000
From: Me <me@example.com>
To: "someone else" <someone@example.org>
Subject: Hello World!
Thread-Topic: Hello World!
Thread-Index: BQHWmN87U8U6MtSDlEOF20sUl0xp+B==
Date: Fri, 2 Oct 2020 17:12:40 +0000
Message-ID: <messageId@servername.outlook.com>
Accept-Language: fr-FR, en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x_my_custom_header=myvalue: X_MY_Custom_Header=myValue
x-originating-ip: [xx.xx.xx.xx]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id:
To me this is working as expected
Adding custome headers in email are not seen on mail recieved.