Results 1 to 5 of 5
  1. #1
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Posts
    96
    Rep Power
    0

    Default problem with sending mail usin javaX.mail api

    Hi to all ,
    I am facing a problem with sending mail from owr own server host like
    mail.---.in ,with some port --- .What my problem is my is excuting perfectly
    when i give server host like gmail.com ,but when i am executing the same program by changing host server like mail.--.in[own server name] and own port like -- , i am getting exception like
    javax.mail.MessagingException: Could not connect to
    SMTP host: mail.---.in, port: --;
    nested exception is:
    java.io.IOException: Couldn't connect using "javax.net.ssl.SSLSocketFactory" socket factory to host, port: smtp.mail.---.in, 465; Exception: java.lang.reflect.InvocationTargetException
    at javax.mail.Transport.send0(Transport.java:219)
    at javax.mail.Transport.send(Transport.java:81)
    I think this problem is because of my server problem or may be i don't any other reason .How to overcome from this problem.Please help me.
    Thanks Regarding,
    sandeep
    Last edited by sandeepsai39; 11-24-2009 at 10:44 AM.

  2. #2
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    236
    Rep Power
    11

    Default

    what is at javax.mail.Transport.send0(Transport.java:219)? should it be send() not send0()?
    when you try to use google's mail server, you must use one they have. smtp.mail.---.in isn't a server google has. You can find them pretty easily but they are:
    gmail-smtp-in.l.google.com
    altX.gmail-smtp-in.l.google.com
    where X is 1, 2, 3, 4
    Also, if you use google's servers, you must also use standerd SMTP port 25. above it looked like it was trying to go to 465.
    Last edited by collin389; 11-25-2009 at 03:16 AM.

  3. #3
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Posts
    96
    Rep Power
    0

    Default

    Actually I am not facing problems with when i am using google server the program is perfectly excuting with google server ,but the problem came into picture when i am using my company server , this is not because either Transport.send0(message) or Transport.send(message) methods in javax.mail.Transport class , I read th source code of javax.mail.Transport.send(message) method it is like
    Java Code:
     public static void send(Message  msg) throws MessagingException  {
        msg.saveChanges(); // do this first
        send0(msg.getAllRecipients());
         }
    The proble is because of our server is unable to connect.we are using our server at host mail.---.in.
    Last edited by sandeepsai39; 11-25-2009 at 06:09 AM.

  4. #4
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    236
    Rep Power
    11

    Default

    Oh, have you tried to telnet to the port and make sure the server works ok?
    Last edited by collin389; 11-25-2009 at 06:20 AM.

  5. #5
    sandeepsai39 is offline Member
    Join Date
    Feb 2009
    Posts
    96
    Rep Power
    0

    Default

    XML Code:
    have you tried to telnet to the port and make sure the server works ok 
    Today
    .
    Thank u for u r quick reply. but iam slowly learning about javax.mail api and i am also week in net working . how would i try with i telnet ,where i find information telnet.I think your saying instead of using smtp.mail.---.in,your are prefering some thinking else by using telnet ,as i am a beginer it takes some time to understand all these concepts . OK, where i find all these information. If my thought is wrong what it is , or how it works? Mean while i search abt this in google. thank u.
    Last edited by sandeepsai39; 11-25-2009 at 06:49 AM.

Similar Threads

  1. Problem in sending mail from java
    By npoorni in forum Advanced Java
    Replies: 1
    Last Post: 06-30-2009, 05:09 PM
  2. Facing problem while sending e-mail
    By jay8186 in forum Java Servlet
    Replies: 1
    Last Post: 03-25-2009, 08:34 AM
  3. Replies: 2
    Last Post: 05-05-2008, 07:01 AM
  4. I can't import javax.mail
    By katie in forum New To Java
    Replies: 2
    Last Post: 08-04-2007, 06:05 PM
  5. Sending a mail with the local mail program
    By thedude in forum Advanced Java
    Replies: 2
    Last Post: 07-23-2007, 01:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •