• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

springframework.mail

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,
A couple of weeks back i written some code to send email using smtp.gmail.com .And it was working fine
But now when i executed the same code it throws the following exception :

Exception in thread "main" org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com;
nested exception is:
java.net.UnknownHostException: smtp.gmail.com
at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:419)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:342)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:357)
at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:346)
at com.mcs.mailer.SpringMailer.sendMail(SpringMailer.java:66)
at com.mcs.mailer.EmailCompTest.main(EmailCompTest.java:20)
Caused by: javax.mail.MessagingException: Unknown SMTP host: smtp.gmail.com;
nested exception is:
java.net.UnknownHostException: smtp.gmail.com


I have set the following properties :
<property name="host" value="smtp.gmail.com"/>
<!-- smtp.mail.yahoo.com-->
<property name="port" value="587"/>

when i did nslookup i got this
>nslookup smtp.gmail.com
DNS request timed out.
timeout was 2 seconds.
*** Can't find server name for address 121.242.180.190: Timed out
DNS request timed out.
timeout was 2 seconds.
*** Can't find server name for address 121.242.180.211: Timed out
*** Default servers are not available
Server: UnKnown
Address: 121.242.180.190

DNS request timed out.
timeout was 2 seconds.
DNS request timed out.
timeout was 2 seconds.
*** Request to UnKnown timed-out

What could be the possible problem?I mean is there something wrong with the 'smtp.gmail.com' or some network settings like firewall or something....
Please advice.

Cheers,
Poonam.
 
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic