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