2
votes

i am new to grails , i created a new project to check mail plugin. In the controller i added the following command in index

sendMail {
            to "[email protected]"
            from "another_valid_id @gmail.com"
            subject  "link test"
            body 'haiiii'
            //html g.render(template:"mailtemplate",model:[code:UUID.randomUUID().toString()])
        }
        render "send"

when i am running the application it shows no error and display send in browser. but when i am checking the my mail inbox mail is not reached. i didn't done any changes in config file. as it by default works in localhost and in port 25.

thankz in advance

1

1 Answers

1
votes

http://grails.org/plugin/mail

By default the plugin assumes an unsecured mail server configured at localhost on port 25. However you can change this via the grails-app/Config.groovy file.

It assumes an unsecured mail server on your localhost on port 25. If there isn't one running there, it won't send mail. I'm not sure what your operating system is, but if you are on a mac or *nix system, postfix comes installed.

 sudo postfix start 

If you're on Windows you can find an alternative. Honestly, it's easy to simply configure to send from a gmail account which is what I have done for my clients. You can see how to do that at the link above.