• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem in sending mail using java mail

 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
What should be my entry in hosts file if I want to send an email to accounts in gmail and yahoo mails. I am developing a java application in which i want to send mail to gmail and yahoo accounts. I am using apache james as my mail server. What settings should be done in apache james. I have already read and tried the settings which are to be done in apache james.
Please help. I have tried a lot. No error comes in console but exception comes in log file of james server. :


10/03/08 13:33:13 INFO dnsserver: Couldn't resolve MX records for domain gmail.com.
10/03/08 13:33:13 WARN dnsserver: Query error!
java.net.PortUnreachableException
at sun.nio.ch.DatagramDispatcher.read0(Native Method)
at sun.nio.ch.DatagramDispatcher.read(DatagramDispatcher.java:25)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:233)
at sun.nio.ch.IOUtil.read(IOUtil.java:206)
at sun.nio.ch.DatagramChannelImpl.read(DatagramChannelImpl.java:324)
at org.xbill.DNS.UDPClient.recv(UDPClient.java:49)
at org.xbill.DNS.UDPClient.sendrecv(UDPClient.java:70)
at org.xbill.DNS.SimpleResolver.send(SimpleResolver.java:256)
at org.xbill.DNS.ExtendedResolver$Resolution.start(ExtendedResolver.java:93)
at org.xbill.DNS.ExtendedResolver.send(ExtendedResolver.java:359)
at org.apache.james.dnsserver.DNSServer.rawDNSLookup(DNSServer.java:337)
at org.apache.james.dnsserver.DNSServer.lookup(DNSServer.java:291)
at org.apache.james.dnsserver.DNSServer.findMXRecords(DNSServer.java:249)
at org.apache.james.dnsserver.DNSServer$1.<init>(DNSServer.java:427)
at org.apache.james.dnsserver.DNSServer.getSMTPHostAddresses(DNSServer.java:426)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invoke(BlockInvocationHandler.java:134)
at $Proxy0.getSMTPHostAddresses(Unknown Source)
at org.apache.james.James.getSMTPHostAddresses(James.java:860)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.avalon.phoenix.components.application.BlockInvocationHandler.invoke(BlockInvocationHandler.java:134)
at $Proxy9.getSMTPHostAddresses(Unknown Source)
at org.apache.james.transport.mailets.RemoteDelivery.deliver(RemoteDelivery.java:452)
at org.apache.james.transport.mailets.RemoteDelivery.run(RemoteDelivery.java:1122)
at java.lang.Thread.run(Thread.java:595)
10/03/08 13:33:13 INFO dnsserver: Couldn't find CNAME records for domain gmail.com.
10/03/08 13:33:13 ERROR dnsserver: Couldn't resolve IP address for host gmail.com.



Waiting for a positive reply ......
Thanks in advance.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to fiddle with host files to do this. The root problem is this "Couldn't resolve IP address for host gmail.com". You need to investigate your network setup why it can't resolve a host name to an IP address.
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I do this. Please guide me. I have installed James on my desktop machine itself. My desktop machine is acting as my mail server. Where do i check if my network is ok.???
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you run a desktop app that looks up a host name, like this one?
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ran the desktop application and I got the following output on running LookUpReach.java application :


Name: gmail.com
Addr: 72.14.253.83
Reach: true
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!