Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get customized "from address" in Grails Email service

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.

like image 368
Suryateja Kosaraju Avatar asked Sep 15 '25 19:09

Suryateja Kosaraju


1 Answers

Complete guess, but does it work if you do:

mailService.sendMail{
  from "XYZ <[email protected]>"
  to "[email protected]"
  subject "HI"
  body "How ru?"
}
like image 96
tim_yates Avatar answered Sep 17 '25 11:09

tim_yates