webtier@glassfish.java.net

Re: [webtier] Configuring Java Mail Session

From: Felipe Gaścho <fgaucho_at_gmail.com>
Date: Fri, 12 Feb 2010 09:08:07 +0100

you can use command line to configure such resources...

here you find examples of scripts to configure Glassfish resources:
http://kenai.com/projects/puj/sources/arena/show/arena-puj?rev=445

For example, you can configure a GMail SMTP typing the following
command in a console:

asadmin --interactive=false create-javamail-resource
--mailhost=$MAIL_HOST --mailuser=$MAIL_USER --fromaddress=$MAIL_FROM
--enabled=true --description="e-Mail account used to confirm the
registration of the Arena PUJ users" --storeprotocol=imap
--storeprotocolclass=com.sun.mail.imap.IMAPStore --transprotocol smtp
--transprotocolclass com.sun.mail.smtp.SMTPSSLTransport --property
mail-smtp.user=$MAIL_SMTP_USER:mail-smtp.port=465:mail-smtp.password=$MAIL_SMTP_PASSWORD:mail-smtp.auth=true:mail-smtp.socketFactory.fallback=false:mail-smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory:mail-smtp.socketFactory.port=$MAIL_SMTP_PORT:mail-smtp.starttls.enable=true
mail/arena

Glassfish official info here:
http://docs.sun.com/app/docs/doc/820-7701/create-javamail-resource-1?a=view

* you should be able to configure all these parameters in the
Graphical interface as well, it is a matter of personal preference ..
but sometimes I loose more time looking for buttons and forms than
trigger that through line commands.. :)



On Fri, Feb 12, 2010 at 4:34 AM, <webtier_at_javadesktop.org> wrote:
> How can i show you the attachment , there is no option here for the attachments
>
> here are the values
>
> JNDI Name : mailServer
> Mail Host : mail.simas2.ch
> Default User : mailHostUser
> Status : enabled
>
> Advanced
>
> Store Protocol : imap
> Store Protocol Class : com.sun.mail.imap.IMAPStore
> Transport Protocol : smtp
> Transport Protocol Class : com.sun.mail.smtp.SMTPTransport
>
> and i have added an additional property
> mail-password : tomypassword
>
>
> hope you got idea from these config
> thanks
> [Message sent by forum member 'duke_nuke' (khurram_noor_at_msn.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=386283
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>



-- 
------------------------------------------
   Felipe Gaścho
   10+ Java Programmer
   CEJUG Senior Advisor