problem in sending mail

1,093 views
Skip to first unread message

Shafik Ahamed

unread,
Jul 24, 2008, 1:49:22 PM7/24/08
to atg_...@googlegroups.com
hi,
  i got a problem in sending mail . i used TemplateEmailSender class to send email.I did configuration in the following components.

SMTPEmail component


# /atg/dynamo/service/SMTPEmail
#Wed Jul 18 15:26:45 EDT 2007
defaultFrom=x...@gmail.com
password=xxxxx
username=xxx...@gmail.com

I gave my email id and password as username and password and in my configuration component i did the following configuration

emailHandlerHost=smtp.gmail.com
emailHandlerPort=465
defaultDynamoPrefix=

I am trying to send a mail using gmails smtp host but i am getting the following error

23:27:24,212 INFO  [STDOUT] DEBUG: setDebug: JavaMail version 1.4ea
23:27:24,216 INFO  [STDOUT] DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]
23:27:24,246 INFO  [STDOUT] DEBUG SMTP: useEhlo true, useAuth false
23:27:24,247 INFO  [STDOUT] DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL false
23:27:34,207 ERROR [SMTPEmail] Could not open an SMTP connection
23:27:34,234 ERROR [ProfileFormHandler] TemplateEmailInfo: Unable to send email
CAUGHT AT:
CONTAINER:atg.userprofiling.email.TemplateEmailException: atg.service.email.EmailException: Could not open an SMTP connection; SOURCE:atg.service.email.EmailException: Could not open an SMTP connection
        at atg.userprofiling.email.TemplateEmailSender.doSendEmailMessage(TemplateEmailSender.java:2323)
        at atg.userprofiling.email.TemplateEmailSender.doSendEmailMessage(TemplateEmailSender.java:1983)
        at atg.userprofiling.email.TemplateEmailSender.sendEmailMessage(TemplateEmailSender.java:1737)
        at atg.userprofiling.email.TemplateEmailSender.sendEmailMessage(TemplateEmailSender.java:1525)
        at fender.userprofiling.FENDERProfileFormHandler.postCreateUser(FENDERProfileFormHandler.java:196)
        at atg.userprofiling.ProfileForm.handleCreate(ProfileForm.java:1114)
        at atg.userprofiling.ProfileFormHandler.handleCreate(ProfileFormHandler.java:369)
        at fender.userprofiling.FENDERProfileFormHandler.handleCreate(FENDERProfileFormHandler.java:

Can any one plz tell me whats the problem and also what will be the suitable value for emailhandlerHost and port so that i can send an email from my local system


Ronak Shah

unread,
Jul 24, 2008, 2:51:51 PM7/24/08
to atg_...@googlegroups.com
Form log below it says ,246 INFO  [STDOUT] DEBUG SMTP: useEhlo true, useAuth false -- to me it seems like it is not able to login with the id/password you have in configuration.
-ronak

Shafik Ahamed

unread,
Jul 24, 2008, 3:12:14 PM7/24/08
to atg_...@googlegroups.com

Hi Ronak shah ,
thanks for ur response , but i gave my own mail id and password .. i dont know y its showing error in auth my user id.. It shows that isSSL value as false .. i think if i set the secure socket layer to true i can send mail , but i dont know how to set it and i am also unable to figure out whats the exact problem is..if u know the configuration to send mail from local host plz let me know.. thanks in advance...




Ronak

unread,
Jul 24, 2008, 5:01:58 PM7/24/08
to ATG_Tech
I have not used gmail smtp but check

http://mail.google.com/support/bin/answer.py?hl=en&answer=13287

You may have to add some more properties to OOTB smtp component. Also,
you can test it by going to http://host:adminPort/nucleus/atg/dynamo/service/SMTPEmail/
and running
openConnection method from there.

Jeremy Sears

unread,
Jul 25, 2008, 12:13:24 PM7/25/08
to atg_...@googlegroups.com
I think you need to add the following to the end of your JAVA_ARGS, so
that SSL is enabled for the SMTP protocol:

-Dmail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

Alternatively, you can extend the SMTPEmailSender component and add
the following to a static block or its constructor (as long as it is
executed before the rest of the service starts up):

Properties props = System.getProperties();
props.setProperty( "mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");

I'm not sure that'll enable connection authentication, but I think
it'll work. If that doesn't work, I'd extend the SMTPEmailSender
class and re-implement the openConnection() method to return a
Transport object that is configured according to the requirements of
your specific SMTP server.

Useful threads:
http://www.javaworld.com/javatips/jw-javatip115.html
http://forums.java.sun.com/thread.jspa?threadID=591321&start=0&tstart=0
--
Jeremy Sears

Shafik Ahamed

unread,
Jul 25, 2008, 1:55:28 PM7/25/08
to atg_...@googlegroups.com

hi thanks for ur reply .it seems to be some what close in solving my problem .. will try it and let u know..


ATG Developer

unread,
Aug 24, 2008, 4:12:09 AM8/24/08
to ATG_Tech
Hi Jeremy/Shafik,


I have extended the funtionality Shafik started with and am still
unable to send mails using the smtp.gmail.com:465
I have used my valid username and password.

Am getting the following exception :
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[8/24/08 13:38:23:796 IST] 00000026 SystemOut O DEBUG SMTP:
useEhlo true, useAuth false
[8/24/08 13:38:23:796 IST] 00000026 SystemOut O DEBUG SMTP: trying
to connect to host "smtp.gmail.com", port 465

[8/24/08 13:38:24:468 IST] 00000026 SystemOut O DEBUG SMTP:
exception reading response: javax.net.ssl.SSLHandshakeException:
com.ibm.jsse2.util.h: No trusted certificate found
[8/24/08 13:38:24:468 IST] 00000026 SystemOut O /atg/dynamo/
service/SMTPEmail Connection failed on try 1 of 4.
[8/24/08 13:38:24:468 IST] 00000026 SystemOut O /atg/dynamo/
service/SMTPEmail Attempting to open a connection...
[8/24/08 13:38:24:468 IST] 00000026 SystemOut O DEBUG SMTP:
useEhlo true, useAuth false
[8/24/08 13:38:24:468 IST] 00000026 SystemOut O DEBUG SMTP: trying
to connect to host "smtp.gmail.com", port 465
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Has anybody got any idea about this????

Thanks.



On Jul 25, 10:55 pm, "Shafik Ahamed" <shafik....@gmail.com> wrote:
> > hi thanks for ur reply .it seems to be some what close in solving my
> > problem .. will try it and let u know..- Hide quoted text -
>
> - Show quoted text -

Adam Petri

unread,
Aug 24, 2008, 10:38:34 AM8/24/08
to atg_...@googlegroups.com

Do you have the google certificate in your SSL store? That's what the problem is. A quick (google) search for this error shows this:

http://groups.google.com/group/Google-Base-data-API/browse_thread/thread/1dff5c22039593ec/

--- On Sun, 8/24/08, ATG Developer <vibhor...@gmail.com> wrote:

ATG Developer

unread,
Aug 26, 2008, 4:03:14 AM8/26/08
to ATG_Tech
Hi Adam,
Thanks for your reply
I have already went through this thread and tried doing the steps
mentioned, however i do not have the IBM HTTP Server Key Management
Utility to create my own certificate.
http://www.hostmultiplesites.com/googlewebsphere.html

I have downloaded the certificate provided in this thread, however
this is already expired on 5/14...
If someone has knowledge of creating a new certificate i will be
thankful so that i can try the steps mentioned to solve this problem.

Thanks.

On Aug 24, 9:38 am, Adam Petri <adampe...@yahoo.com> wrote:
> Do you have the google certificate in your SSL store? That's what the problem is. A quick (google) search for this error shows this:
>
> http://groups.google.com/group/Google-Base-data-API/browse_thread/thr...
>
> --- On Sun, 8/24/08, ATG Developer <vibhorjai...@gmail.com> wrote:
>
>
>
> > From: ATG Developer <vibhorjai...@gmail.com>
> > Subject: [atg_tech:1609] Re: problem in sending mail
> > To: "ATG_Tech" <atg_...@googlegroups.com>
> > Date: Sunday, August 24, 2008, 4:12 AM
> > Hi Jeremy/Shafik,
>
> > I have extended the funtionality Shafik started with and am
> > still
> > unable to send mails using the smtp.gmail.com:465
> > I have used my valid username and password.
>
> > Am getting the following exception :
> > ---------------------------------------------------------------------------­---------------------------------------------------------------------------­---------------------------------------------------------------------------­---------------------------------------------
> > [8/24/08 13:38:23:796 IST] 00000026 SystemOut     O DEBUG
> > SMTP:
> > useEhlo true, useAuth false
> > [8/24/08 13:38:23:796 IST] 00000026 SystemOut     O DEBUG
> > SMTP: trying
> > to connect to host "smtp.gmail.com", port 465
>
> > [8/24/08 13:38:24:468 IST] 00000026 SystemOut     O DEBUG
> > SMTP:
> > exception reading response:
> > javax.net.ssl.SSLHandshakeException:
> > com.ibm.jsse2.util.h: No trusted certificate found
> > [8/24/08 13:38:24:468 IST] 00000026 SystemOut     O
> > /atg/dynamo/
> > service/SMTPEmail  Connection failed on try 1 of 4.
> > [8/24/08 13:38:24:468 IST] 00000026 SystemOut     O
> > /atg/dynamo/
> > service/SMTPEmail  Attempting to open a connection...
> > [8/24/08 13:38:24:468 IST] 00000026 SystemOut     O DEBUG
> > SMTP:
> > useEhlo true, useAuth false
> > [8/24/08 13:38:24:468 IST] 00000026 SystemOut     O DEBUG
> > SMTP: trying
> > to connect to host "smtp.gmail.com", port 465
> > ---------------------------------------------------------------------------­---------------------------------------------------------------------------­---------------------------------------------------------------------------­---------------------------------------------
>
> > Has anybody got any idea about this????
>
> > Thanks.
>
> > On Jul 25, 10:55 pm, "Shafik Ahamed"
> > <shafik....@gmail.com> wrote:
> > > > hi thanks for ur reply .it seems to be some what
> > close in solving my
> > > > problem .. will try it and let u know..- Hide
> > quoted text -
>
> > > - Show quoted text -- Hide quoted text -
Reply all
Reply to author
Forward
0 new messages