Sending Emails from Grails

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Sending Emails from Grails

Kerry Wilson-3
Has this been implemented yet?

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Sending Emails from Grails

graemer
Kerry,

This is the class I developed that uses apache commons email... we
could include it in Grails:

import org.apache.commons.mail.SimpleEmail
import org.apache.commons.mail.HtmlEmail

class Notifications {

        static def sendNotification(from,to,subject,message) {
                def email = new SimpleEmail(
                   hostName: ApplicationConfig.EMAIL_SERVER,
                   subject : subject,
                   msg     : message
                )
                email.setFrom(from, from)
                email.addTo(to, to)
                email.send()
        }
       
        static def sendNotification(to,subject,message) {
                def email = new SimpleEmail(
                   hostName: ApplicationConfig.EMAIL_SERVER,
                   subject : subject,
                   msg     : message
                )
                email.setFrom(ApplicationConfig.SYSTEM_EMAIL ,
ApplicationConfig.SYSTEM_FROM_ADDRESS)
                email.addTo(to, to.toString())
                email.send()
        }

        static def sendHtmlNotification(from,to,subject,message) {
                def email = new HtmlEmail(
                   hostName: ApplicationConfig.EMAIL_SERVER,
                   subject : subject,
                   htmlMsg     : message,
                   textMsg : message
                )
                email.setFrom(from, from)
                email.addTo(to, to)
                email.send()
        }
       
        static def sendHtmlNotification(to,subject,message) {
                def email = new HtmlEmail(
                   hostName: ApplicationConfig.EMAIL_SERVER,
                   subject : subject,
                   htmlMsg     : message,
                   textMsg : message
                )
                email.setFrom(ApplicationConfig.SYSTEM_EMAIL ,
ApplicationConfig.SYSTEM_FROM_ADDRESS)
                email.addTo(to, to)
                email.send()
        }
}

Graeme

On 6/27/06, Kerry Wilson <[hidden email]> wrote:
> Has this been implemented yet?
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Sending Emails from Grails

Marc Palmer Local

On 27 Jun 2006, at 09:09, Graeme Rocher wrote:

> Kerry,
>
> This is the class I developed that uses apache commons email... we
> could include it in Grails:

Out of interest, why is this not using the Spring simple mail message  
stuff? It adds a little value doesn't it vis configuration if I recall.

Marc


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Sending Emails from Grails

graemer
On 6/27/06, Marc Palmer <[hidden email]> wrote:

>
> On 27 Jun 2006, at 09:09, Graeme Rocher wrote:
>
> > Kerry,
> >
> > This is the class I developed that uses apache commons email... we
> > could include it in Grails:
>
> Out of interest, why is this not using the Spring simple mail message
> stuff? It adds a little value doesn't it vis configuration if I recall.

No reason, I was just more familiar with commons email at the time and
had a deadline to meet :-)

Graeme

>
> Marc
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Sending Emails from Grails

Kerry Wilson-3
Is it possible to use Spring simple mail message, right now?

Graeme Rocher wrote:

> On 6/27/06, Marc Palmer <[hidden email]> wrote:
>>
>> On 27 Jun 2006, at 09:09, Graeme Rocher wrote:
>>
>> > Kerry,
>> >
>> > This is the class I developed that uses apache commons email... we
>> > could include it in Grails:
>>
>> Out of interest, why is this not using the Spring simple mail message
>> stuff? It adds a little value doesn't it vis configuration if I recall.
>
> No reason, I was just more familiar with commons email at the time and
> had a deadline to meet :-)
>
> Graeme
>
>>
>> Marc
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>

--
Kerry Wilson
Lead Developer
Williams Web
[hidden email] | 423.485.4747


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

kwilson.vcf (292 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Sending Emails from Grails

graemer
Sure I don't see why not, just follow the instructions here:

http://www.springframework.org/docs/reference/mail.html

Graeme

On 6/27/06, Kerry Wilson <[hidden email]> wrote:

> Is it possible to use Spring simple mail message, right now?
>
> Graeme Rocher wrote:
> > On 6/27/06, Marc Palmer <[hidden email]> wrote:
> >>
> >> On 27 Jun 2006, at 09:09, Graeme Rocher wrote:
> >>
> >> > Kerry,
> >> >
> >> > This is the class I developed that uses apache commons email... we
> >> > could include it in Grails:
> >>
> >> Out of interest, why is this not using the Spring simple mail message
> >> stuff? It adds a little value doesn't it vis configuration if I recall.
> >
> > No reason, I was just more familiar with commons email at the time and
> > had a deadline to meet :-)
> >
> > Graeme
> >
> >>
> >> Marc
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >    http://xircles.codehaus.org/manage_email
> >
> >
>
>
> --
> Kerry Wilson
> Lead Developer
> Williams Web
> [hidden email] | 423.485.4747
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

RE: Sending Emails from Grails

Dierk König
Is EMails another Rails clone?

;-)

Mittie

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email