Closed adhinugroho1711 closed 7 years ago
Yes, you can add custom headers to the outgoing email. Just use the parameter(String,String)
method of the MailBuilder
class and send a parameter starting with ' h:' as explained in the mailgun documentation.
MailBuilder.using(configuration)
.to("marty@mcfly.com")
.subject("This is a plain text test")
.text("Hello world!")
.parameter("h:CustomHeader", "The header value")
.build()
.send();
The above example will add a header named CustomHeader to the message.
hello,
can i add header on email? if yes, how to add?
thankyou