Not sure if this is possible. We send emails in our Spring Boot application, using MessageHelper we set the FROM. However, when the email is received we see a different from in the mail client.
So I can understand why, but we were hoping it might be possible to show a different value.
We use Gmail as the sender and have a Gmail account that the emails get sent from, so it has an email address that we will call myaccount@gmail.com We use that address in the
spring.mail.username=myaccount@gmail.com
In the code we set the From via either MimeMessage or MimeMessageHelper, but in the end they update the same MimeMessage instance.
messageHelper.setFrom("support@mycompany.com");
message.setFrom("support@mycompany.com");
If the message gets sent and looking at the recipients mail client it show in the From column "myaccount@gmail.com". But we want it to show support@mycompany.com
I know technically the email message is sent from the myaccount@gmail.com and in the headers it can show that, but for the UI we want to show support@mycompany.com