• 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

Setting Up A Delay Between E-mail tranmissions

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am doing a bulk email of about 100 e-mails. After 80 or so successful tranmissions an exception is thrown: Could not connect to SMTP host. The exception is thrown on about 5 transmissions, then it will successfully complete the remaining e-mail tranmissions. My web hosting provider suggested setting up a delay between transmissions, as the message queue is being filled up and needs time to complete each tranmission. How can I set up this delay between email?
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By calling Thread.sleep()?
 
Rick Fischer
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ernest, That worked
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you explain what you mean by "tranmissions"? Is this when you call the connect method on a Transport object or when you call the send method?

I ask because it could be that you are using the static convenience method Transport.send(), which opens and closes a new connection for every message you send. You might consider reusing the connection. That is so long as your are not spoofing the from address (or changing it once you have spoofed it once) you should be able to reuse one connection for all messages. And though your server admin probably knows better then I do - it would take a fairly miserly server config to not be able to process 100 messages.
reply
    Bookmark Topic Watch Topic
  • New Topic