• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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.
reply
    Bookmark Topic Watch Topic
  • New Topic