Thanks for the input,

I was able to actually send email from Outlook Express after changing port
numbers and changing the host name to smtp.gmail.com instead of
smtp.google.com.

Now I encountered a different problem - when I attempt to send an email from
a servlet running on my local XP machine it looks like it is doing something
but the green bar in the browser doesn't progress, it is there but stays
white. And no exceptions thrown. Just sitting there not proceeding to the
next page. Like it is trying to send an email but it is taking a year.

On 4/16/07, Len Popp <[EMAIL PROTECTED]> wrote:

That's a timeout error. I was able to send an email thru
smtp.google.com using Outlook Express, with no timeout error, so it
looks like there's something wrong with either your email settings or
your connection to gmail.com (firewall or something).

Google has a troubleshooter program to diagnose POP & SMTP setup problems:
http://mail.google.com/support/bin/answer.py?answer=44769
--
Len

On 4/16/07, Mighty Tornado <[EMAIL PROTECTED]> wrote:
> I heeded your advice and tried setting up Outlook Express for gmail
server.
> This is the message that I got:
> The connection to the server has failed. Account: 'smtp.google.com',
Server:
> 'smtp.google.com', Protocol: SMTP, Port: 25, Secure(SSL): No, Socket
Error:
> 10060, Error Number: 0x800CCC0E
>
> On 4/15/07, Johnny Kewl <[EMAIL PROTECTED]> wrote:
> >
> >
> > Here is a little framework that u can play with
> >
> >         MimeMessage msg = new MimeMessage(session);
> >         msg.setFrom(new InternetAddress(from));
> >         msg.addRecipient(Message.RecipientType.TO, new
> > InternetAddress(to));
> >         msg.setSubject(subject);
> >         msg.setSentDate(new Date());
> >
> >      // ADD TEXT
> >      MimeBodyPart mbp1 = new MimeBodyPart();
> >      mbp1.setText(sMessage);
> >
> >             //ADD ATTACHEMENT
> >             MimeBodyPart mbp2 = new MimeBodyPart();
> >             if (sFilename.length() > 0){
> >                 mbp2.setFileName(sFilename);
> >                 mbp2.setText(sAttachment, "us-ascii");
> >             }
> >
> >      // JOIN THEM
> >      Multipart mp = new MimeMultipart();
> >      mp.addBodyPart(mbp1);
> >      if (sFilename.length() > 0) mp.addBodyPart(mbp2);
> >
> >      // ADD and SEND
> >     msg.setContent(mp);
> >     Transport.send(msg);
> >
> >
> > Have fun
> >
> > ----- Original Message -----
> > From: "Mighty Tornado" <[EMAIL PROTECTED]>
> > To: "Tomcat Users List" <users@tomcat.apache.org>
> > Sent: Sunday, April 15, 2007 2:32 AM
> > Subject: Re: sending smtp mail failure
> >
> >
> > > Thanks for responding,
> > >
> > > there something wrong with my code?
> > > This is my code:
> > >
> > > import java.util.*;
> > > import java.io.*;
> > > import javax.mail.*;
> > > import javax.mail.internet.*;
> > > import javax.activation.*;
> > >
> > >
> > >
> > >
> > > public class TimeTravelMailer
> > > {
> > >    public void sendMessage()
> > >    {
> > >        String to = "[EMAIL PROTECTED]";
> > >        String from = "[EMAIL PROTECTED]";
> > >        String host = "smtp.google.com";
> > >        String message = "This is a test";
> > >
> > >        Properties props = new Properties();
> > >
> > >        props.put("mail.smtp.host", host);
> > >
> > >        Session session = Session.getInstance(props);
> > >
> > >        try
> > >        {
> > >            Transport bus = session.getTransport("smtp");
> > >
> > >            bus.connect(host, "[EMAIL PROTECTED]", "
[EMAIL PROTECTED]
> > ");
> > >
> > >            Message msg = new MimeMessage(session);
> > >
> > >            msg.setFrom(new InternetAddress(from));
> > >
> > >            InternetAddress[] address = {new InternetAddress(to)};
> > >
> > >            msg.setRecipients(Message.RecipientType.TO, address);
> > >
> > >            msg.setRecipients(Message.RecipientType.CC,
> > > InternetAddress.parse(to, true));
> > >
> > >            msg.setRecipients(Message.RecipientType.BCC,
> > > InternetAddress.parse(to, false));
> > >
> > >            msg.setSubject("Test E-Mail through Java");
> > >
> > >            msg.setSentDate(new Date());
> > >
> > >            msg.setText(message);
> > >
> > >            msg.saveChanges();
> > >
> > >              bus.sendMessage(msg, address);
> > >
> > >              bus.close();
> > >        }
> > >        catch(Exception ex)
> > >        {
> > >            ex.printStackTrace();
> > >        }
> > >    }
> > > }
> > >
> > > On 4/7/07, Johnny Kewl <[EMAIL PROTECTED]> wrote:
> > >>
> > >>
> > >> Easiest way is to setup a normal email program and see what the
error
> > >> messages are.
> > >> If the machine doesnt have core mailing engines installed, it will
> > >> probably
> > >> tell you.
> > >> If you on windows, try Outlook express, detailed messages will
probably
> > >> point you in right direction.
> > >>
> > >> Code should look something like this
> > >>
> > >>
> > >>     public boolean prepareConnection(String smtpHost){
> > >>         this.smtpHost = smtpHost;
> > >>         fSessionInited = true;
> > >>
> > >>     try{
> > >>         java.util.Properties properties = System.getProperties();
> > >>         properties.put("mail.smtp.host", smtpHost);
> > >>         session = Session.getInstance(properties,null);
> > >>         } catch(Exception e) {
> > >>            fSessionInited = false;
> > >>         }
> > >>
> > >>         return fSessionInited;
> > >>     }
> > >>
> > >>
> > >>
> > >>
> > >> ----- Original Message -----
> > >> From: "Mighty Tornado" <[EMAIL PROTECTED]>
> > >> To: <users@tomcat.apache.org>
> > >> Sent: Friday, April 06, 2007 7:30 AM
> > >> Subject: sending smtp mail failure
> > >>
> > >>
> > >> > Hi,
> > >> >
> > >> > I set up a small web app and the servlet is supposed to send an
email
> > >> > using
> > >> > JavaMail. But I am getting exceptions - Connection Timed out
every
> > >> > time.
> > >> I
> > >> > am using Gmail as an smtp server to bounce emails off. How can I
> > avoid
> > >> the
> > >> > Connection Timed out exception? Could it be because of my
firewall?
> > If
> > >> so,
> > >> > which process should I permission?
> > >> >
> > >> > Thank you,
> > >> >
> > >> > MT
> > >> >
> > >>
> > >>
> > >>
---------------------------------------------------------------------
> > >> To start a new topic, e-mail: users@tomcat.apache.org
> > >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >> For additional commands, e-mail: [EMAIL PROTECTED]
> > >>
> > >>
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to