Errors with Java Mail Programming.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #1

    Errors with Java Mail Programming.

    I am using SMTP mail server.
    I am sending a mail from SMTP client using Java Mail.
    But now i am getting this exception...

    Relaying denied. IP name possibly forged

    The debug informations given below ....
    "DEBUG: setDebug: JavaMail version 1.4.1
    DEBUG: getProvider() returning javax.mail.Prov ider[TRANSPORT,smtp, com.sun.mail.sm tp.SMTPTranspor t,Sun Microsystems, Inc]
    DEBUG SMTP: useEhlo true, useAuth false
    DEBUG SMTP: trying to connect to host "iem.iitkgp.ern et.in", port 25, isSSL false
    220 iem.iitkgp.erne t.in ESMTP Sendmail 8.12.8/8.12.8; Wed, 23 Jul 2008 17:51:36 +0530
    DEBUG SMTP: connected to host "iem.iitkgp.ern et.in", port: 25

    EHLO pal
    250-iem.iitkgp.erne t.in Hello [10.29.33.249], pleased to meet you
    250-ENHANCEDSTATUSC ODES
    250-PIPELINING
    250-8BITMIME
    250-SIZE
    250-DSN
    250-ETRN
    250-DELIVERBY
    250 HELP
    DEBUG SMTP: Found extension "ENHANCEDSTATUS CODES", arg ""
    DEBUG SMTP: Found extension "PIPELINING ", arg ""
    DEBUG SMTP: Found extension "8BITMIME", arg ""
    DEBUG SMTP: Found extension "SIZE", arg ""
    DEBUG SMTP: Found extension "DSN", arg ""
    DEBUG SMTP: Found extension "ETRN", arg ""
    DEBUG SMTP: Found extension "DELIVERBY" , arg ""
    DEBUG SMTP: Found extension "HELP", arg ""
    DEBUG SMTP: use8bit false
    MAIL FROM:<erp@iem.i itkgp.ernet.in>
    250 2.1.0 <erp@iem.iitkgp .ernet.in>... Sender ok
    RCPT TO:<debasis.jan a.iit@gmail.com >
    550 5.7.1 <debasis.jana.i it@gmail.com>.. . Relaying denied. IP name lookup failed [10.29.33.249]
    DEBUG SMTP: Invalid Addresses
    DEBUG SMTP: debasis.jana.ii t@gmail.com
    DEBUG SMTP: Sending failed because of invalid destination addresses
    RSET
    250 2.0.0 Reset state
    javax.mail.Send FailedException : Invalid Addresses;
    nested exception is:
    com.sun.mail.sm tp.SMTPAddressF ailedException: 550 5.7.1 <debasis.jana.i it@gmail.com>.. . Relaying denied. IP name lookup failed [10.29.33.249]"

    Please help me to figure out.
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Actually mail server is not supporting cross domain mail sending.
    With in the same domain it is working.
    But in spite of having a solution i still have a lot of problems .....

    [code=java]
    Properties props = new Properties();
    props.put("mail .smtp.host", "iem.iitkgp.ern et.in");
    props.put("mail .debug",true);

    Session session = Session.getInst ance(props,new Authenticator() {
    protected PasswordAuthent ication getPasswordAuth entication(){
    return new PasswordAuthent ication("erp@ie m.iitkgp.ernet. in","erp2008" );
    }
    });
    session.setDebu g(true);

    Message msg = new MimeMessage(ses sion);
    msg.setFrom(new InternetAddress ("erp@iem.iitkg p.ernet.in"));
    InternetAddress[] address = {new InternetAddress ("debasis.jana. iit@gmail.com") };
    msg.setRecipien ts(Message.Reci pientType.TO, address);
    msg.setSubject( "JavaMail APIs Test");
    msg.setSentDate (new Date());
    msg.setText("Th is is a message body.\nHere's the second line.");

    Transport.send( msg);
    [/code]

    This is my source code.
    If i change the from address to wrong address and even it is from cross domain then still it's working.
    Anyway I think need to go through the details of SMTP server.
    I think then i can figure out myself what's wrong with it.
    I need all of your best wishes.

    Comment

    Working...