• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

JavaMail and Gmail  RSS feed

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

The program of JavaMail to send email by using gmail SMTP server was working correctly in Windows 7. When I tested the program in Windows XP in a different machine, then the email is not going. Either Messaging or SendMail exception comes. I have used JDK1.6 and NetBeans 5.5 in both the machines.

Kindly let me know whether the problem is because of change of OS (in which case some changes in coding may be needed) or some setting needs to be done in NetBeans, which was taken automatically in Windows 7.

The code is=





 
Sheriff
Posts: 21745
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags. You can use the edit button to add them.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And correct the indentation.

Also, please see ItDoesntWorkIsUseless: what's actually happening? Are the same ports open on both machines? Are the machine's firewall/etc. settings the same?
 
Khushbu Arora
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting MessagingException and SendFailedException. How to check for the opened ports in Windows? In Windows XP, I have disabled firewall but its enabled with few settings in Windows 7. In spite of the fact that firewall is enabled in Win 7, there are no issues with the program. On the contrary, disabling the firewall in Windows XP didn't solve my problem.

I think the issue is with the ports only. Can you please help me in finding out the closed ports in Win? For gmail smtp server (since I'm sending and receiving messages in gmail only through my application), what should be the port number to be checked?

 
Rancher
Posts: 42974
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would help if you posted the complete error messages with their respective stack traces.
 
Rob Spoor
Sheriff
Posts: 21745
102
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you already read How do I access Gmail with JavaMail?
 
Khushbu Arora
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Following exception is generated:

javax.mail.MessagingException: can't determine local email address




Yes, I've already gone through that text but the code which I wrote is already working in one machine with Win 7. So, I think the issue should not be with the code only.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Khushbu Arora wrote:Following exception is generated:

javax.mail.MessagingException: can't determine local email address




Yes, I've already gone through that text but the code which I wrote is already working in one machine with Win 7. So, I think the issue should not be with the code only.


That, Sir, is a very dangerous assumption. Just because some code works in one environment doesn't mean the code is correct. If you close yourself off to possibilities which other, possibly more experienced developers are pointing out to you, you run the risk of never solving your problem.
 
Get me the mayor's office! I need to tell him about this tiny ad:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!