I have question regarding Email service "from" address. I want to show a name say XYZ instead of [email protected]. I tried to have it have a string "XYZ" in from but i was getting a mailsend exception.
mailService.sendMail{
from "XYZ"
to "[email protected]"
subject "HI"
body "How ru?"
}
The Exception is:
org.springframework.mail.MailSendException:
Failed messages: com.sun.mail.smtp.SMTPSendFailedException:
553 5.5.4 <XYZ>... Domain name required for sender address XYZ.
Is there any way to have a alias name instead of from address in the from coloumn of the mail?
Thanks.
Complete guess, but does it work if you do:
mailService.sendMail{
from "XYZ <[email protected]>"
to "[email protected]"
subject "HI"
body "How ru?"
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With