aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Java Mail Api : unable to send mail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java Mail Api : unable to send mail" Watch "Java Mail Api : unable to send mail" New topic
Author

Java Mail Api : unable to send mail

prasenjitkumar das
Greenhorn

Joined: Mar 17, 2010
Posts: 12
Hi all
I have written a service to send mail
it is using java mail api.
I am able to send mail from following id (using the services )
gmail to yahoo mail , "abcd" mail( my company )
and from yahoo to gmail , "abcd" mail ,
"abcd" to gmail and yahoo mail
BUT unable to send mail to "XYZ".com
The postmaster of "XYZ".com is giving following information
This is an automatically generated Delivery Status Notification.



Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.

lmn.@"XYZ".com




Final-Recipient: rfc822;lmn.@"XYZ".com
Action: failed
Status: 4.7.1
Diagnostic-Code: smtp;450 4.7.1 Client host rejected: cannot find your reverse hostname, [124.153.77.24]


---------- Forwarded message ----------
From: pqr@"abcd".com
To: lmn.@"XYZ".com
Date: 11 Jun 2010 10:53:14 +0530
Subject: Please Reply if you get this mail
Testing Email module from "abcd" Technologies jun 11 2010 11am

And some times it is giving message :

This is an automatically generated Delivery Status Notification.

Delivery to the following recipients failed.

lmnop.@"XYZ".com




Final-Recipient: rfc822;lmnop.@"XYZ".com
Action: failed
Status: 5.1.1
Diagnostic-Code: smtp;550 5.1.1 <lmnop@"XYZ".com>: Recipient address rejected: User unknown in virtual alias table


---------- Forwarded message ----------
From: ccportal@mycard.co.in
To: lmnop@"XYZ".com
Date: 18 Jun 2010 11:11:16 +0530
Subject: New SR for your action(CC1806100003 Registered)
Service Request::CC1806100003 Created on::June 18, 2010 11:11:16 AM GMT+05:30

Requested Comment::customer wants to register his points , product was purchased on 15 of June from Next


We are using Windows Server 2003
Please check the code below

Thank You



[edit: code tags, removed big fonts and bright colors]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61433
    
  67

Please be sure to use code tags when posting code to the forums. Unformatted or unindented code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please click this link ⇒ UseCodeTags ⇐ for more information.

Properly indented and formatted code greatly increases the probability that your question will get quicker, better answers.

Also, avoid color except for emphasis. Making your posts hard to read will not help your cause.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
The very first error message hints pretty strongly at the problem:
Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.

lmn.@"XYZ".com

Domain names can't contain quotation marks.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Bear Bibeault wrote:Also, avoid color except for emphasis. Making your posts hard to read will not help your cause.

Fixed.
Arvind Purohit
Ranch Hand

Joined: Jun 18, 2010
Posts: 43
Ulf Dittmer wrote:The very first error message hints pretty strongly at the problem:
Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.

lmn.@"XYZ".com

Domain names can't contain quotation marks.

can you please explain solution in detail
Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
Not sure what to explain - the error message says that the email address contains double quotes, which isn't allowed, especially not as part of the domain name.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Arvind Purohit wrote:can you please explain solution in detail

Remove the quotation marks.
Arvind Purohit
Ranch Hand

Joined: Jun 18, 2010
Posts: 43
David Newton wrote:
Arvind Purohit wrote:can you please explain solution in detail

Remove the quotation marks.



Quotation is not there in actual code, here it is written to just emphasize that mail is not going to a particular domain name say "xyz"
Thank you
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
Well, that was a waste of time then: AvoidRedHerrings

Also, are you the same person as "prasenjit.svnit das"? If so, tell us which account you want to keep so that we can close the other.

The next thing to check into is this:
Diagnostic-Code: smtp;450 4.7.1 Client host rejected: cannot find your reverse hostname, [124.153.77.24]

Some mail servers do this if the machine that sends the mail does not have a DNS MX record for the domain for which they're sending the mail; it's an anti-spam measure. There isn't much that can be done about it, except for moving the mail sending process to a machine that does have an MX record.
Arvind Purohit
Ranch Hand

Joined: Jun 18, 2010
Posts: 43
Ulf Dittmer wrote:Well, that was a waste of time then: AvoidRedHerrings

Also, are you the same person as "prasenjit.svnit das"? If so, tell us which account you want to keep so that we can close the other.

The next thing to check into is this:
Diagnostic-Code: smtp;450 4.7.1 Client host rejected: cannot find your reverse hostname, [124.153.77.24]

Some mail servers do this if the machine that sends the mail does not have a DNS MX record for the domain for which they're sending the mail; it's an anti-spam measure. There isn't much that can be done about it, except for moving the mail sending process to a machine that does have an MX record.

We are not same , but we are working in same project.
sir want to know is there any bug in our program or it it server configuration problem,
We have administrative privileges of the mail sending server( windows 2003 ), can we edit DNS max record to solve this problem and we can do it ?

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
Yes, your network admin can change the DNS settings of servers. (It's not called "max" record, BTW, it's called "MX" record. Also make sure that it has an A record.)
Arvind Purohit
Ranch Hand

Joined: Jun 18, 2010
Posts: 43
Ulf Dittmer wrote:Yes, your network admin can change the DNS settings of servers. (It's not called "max" record, BTW, it's called "MX" record. Also make sure that it has an A record.)

Now it is giving Error :
postmaster@"xyz"
to akpt@abcd.com
date Tue, Jun 22, 2010 at 1:09 PM
subject Delivery Status Notification (Failure)
hide details 1:09 PM (20 hours ago)
This is an automatically generated Delivery Status Notification.

Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server.

lmn@"xyz".com




Final-Recipient: rfc822;lmn@"xyz".com
Action: failed
Status: 4.7.1
Diagnostic-Code: smtp;450 4.7.1 Client host rejected: cannot find your reverse hostname, [124.153.77.24]


---------- Forwarded message ----------
From: akpt@"abcd".com
To: lmn@"xyz".com
Date: 22 Jun 2010 12:24:51 +0530
Subject: This is testing frm incture 22 jun
testing new server config and chnged in server reporting time to 40 min
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
What do you mean, "now"? That's the exact same error message as before, isn't it? What have you changed since then?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Now, are *these* quotation marks actually there? If they're not, you're being *really* misleading and wasting our time. If they are... then what's putting them there if you're not?
Arvind Purohit
Ranch Hand

Joined: Jun 18, 2010
Posts: 43
David Newton wrote:Now, are *these* quotation marks actually there? If they're not, you're being *really* misleading and wasting our time. If they are... then what's putting them there if you're not?


SORRY MY MISTAKE
 
wood burning stoves
 
subject: Java Mail Api : unable to send mail