Situation may arise where we want to send mails to a different mail id in development and production mode.For this Grails provides option of overriding mail so that all mails are send to a common mail id.
In config.groovy do following:
environments {
development {
grails.logging.jul.usebridge = false
grails {
mail {
host = “smtp.gmail.com”
port = 465
username = “sent_from_mail_id”
password = “password”
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
overrideAddress=”sent_to_mail_id”
}
}
}
production {
grails.logging.jul.usebridge = false
grails {
mail {
host = “smtp.gmail.com”
port = 465
username = “sent_from_mail_id”
password = “password”
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
overrideAddress=”sent_to_mail_id”
}
}
}
}
ProsperaSoft offers Grails development solutions. You can email at info@prosperasoft.com to get in touch with ProsperaSoft Grails experts and consultants.