Custom Headers set while sending mail message missing at Receivers end (Aspose email for Java 19.1)

Hi,

I am sending a custom header in my mail message, I followed the following article
https://docs.aspose.com/display/emailjava/Creating+and+Setting+Contents+of+Emails#CreatingandSettingContentsofEmails-SetEmailHeaders

However, the receiver of the mail is not able to see these custom headers.

Here is the code I am using

    //create mail Message

    String from = "kapil@abc.com";
    MailMessage msg = new MailMessage(from, "rohan@abc.com");
    msg.setSubject("Test Id #123");
    msg.setHtmlBody("Test Body Id #123");
    msg.getHeaders().add("secret-header", "mystery");
    //attendees for the event
    MailAddressCollection attendees = new MailAddressCollection();
    String[] stakeholders = "rohan@123.com".split(";");
    for (String stakeholder : stakeholders) {
        attendees.add(stakeholder);
    }

    Appointment app = new Appointment("",
            new Date(System.currentTimeMillis()), new Date(System.currentTimeMillis() + 30 * 60000),
            new MailAddress(from),
            attendees);
    app.setStartTimeZone("UTC");
    app.setEndTimeZone("UTC");
    app.setUniqueId("1234");
    msg.addAlternateView(app.requestApointment());

    SmtpClient client = getMailSenderForClient();
    client.send(msg);

Please let us know if this is a correct way of setting the headers, or I am missing something.

Thanks
Kapil

@kapilgupta,

I have observed your comments. Can you please try to use latest version of Aspose.Email 19.4 on your end and if there is still an issue than please share source file along with generated result so that we may further investigate to help you out.

Hi Adnan, I tried using the latest version still facing the same issue, I have already shared the source code in original question.

Here is the headers that I can see in the Senders Sent Email

“Subject: Test GB Id #123(Aspose.Email Evaluation)
secret-header: mystery
Date: Wed, 29 May 2019 09:45:42 +0000
MIME-Version: 1.0
Content-Type: multipart/alternative;”

We are not getting the header “secret-header” in the Recipients inbox.

@kapilgupta,

I have investigated this issue on my end and an issue with ID EMAILJAVA-34538 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.