Hello There!
I'm having a strange problema wich i've not found a solution.
Im running a code to send e-mail and it works when i run into a Java
Project. But when i copy the code to the server side on Gwt
Application it show the succesfull message, but the email don't
arrive. Someone knows whats the problema? I'm copying below the code
i've used the send the email.

        public static boolean sendEmail(String email){
                final String d_email = "[email protected]";
                final String d_password = "password here";
                final String d_host = "the smtp here";
                final String d_port  = "port number here";
                final String m_to = email;
                final String m_subject = "Testing";
                final String m_text = "Hey, this is the testing email.";

                Properties props = new Properties();
        props.put("mail.smtp.user", d_email);
        props.put("mail.smtp.host", d_host);
        props.put("mail.smtp.port", d_port);
        props.put("mail.smtp.auth", "true");

        try
        {
                class SMTPAuthenticator extends javax.mail.Authenticator {
                public PasswordAuthentication getPasswordAuthentication()
{
                    return new PasswordAuthentication(d_email,
d_password);
                }
            }

            Authenticator auth = new SMTPAuthenticator();
            Session session = Session.getInstance(props, auth);
            session.setDebug(true);

            MimeMessage msg = new MimeMessage(session);
            msg.setText(m_text);
            msg.setSubject(m_subject);
            msg.setFrom(new InternetAddress(d_email));
            msg.addRecipient(Message.RecipientType.TO, new
InternetAddress(m_to));
            Transport.send(msg);
            System.out.println("Message has been sent succesfully.");
            return true;

        }
        catch (Exception mex)
        {
            mex.printStackTrace();
            return false;
        }
        }

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to