Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom headers in email are not seen on mail recieved. #6

Open
santosh103 opened this issue Sep 8, 2020 · 3 comments
Open

Comments

@santosh103
Copy link

Adding custome headers in email are not seen on mail recieved.

@gartcimore
Copy link
Owner

Do you have a sample of what you are doing and what is wrong ?

@santosh103
Copy link
Author

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");

@gartcimore
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants