How to override mail address?

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.

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>