• 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Java Mail API !!!!!!!!!!!!!

Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need an application which has to send 400000 mails in 2 hours
is Java Mail API can handle this requirement or is there any other API available
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just tested the performance with a very simple program:

It takes... about 50(!) seconds to send this 50 mails! This for sure also depends on the mail-server (in this case it is an MSEX) and some other circumstances, but it indicates that it should be a really hard task to achieve your goal...
As you realize, I did not try anything to speed up the sending; for performance questions (and some other) have a look at http://developer.java.sun.com/developer/community/chat/JavaLive/2000/jl1212.html (interview about JavaMail 1.2)
On the other hand, it is less a question of "another" mail-api but a question of the possible use of an other SMTP-provider (I used the SUN-implementation; but on http://java.sun.com/products/javamail/Third_Party.html there is no other).
But: Have a look at http://oss.software.ibm.com/developerworks/projects/smtp and try out, maybe this helps (even if I do not like do leave the sun-path...)
Hope it helps
[This message has been edited by Detlev Beutner (edited July 20, 2001).]
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Will you get better results if you replace with ? I don't know from personal experience (too new to the API), but the short course from JGuru on the Fundamentals of the JavaMail API seems to imply it.

The final part of sending a message is to use the Transport class. This class speaks the protocol-specific language for sending the message (usually SMTP). It's an abstract class and works something like Session. You can use the default version of the class by just calling the static send() method:
Or, you can get a specific instance from the session for your protocol, pass along the username and password (blank if unnecessary), send the message, and close the connection:
message.saveChanges(); // implicit with send()
Transport transport = session.getTransport("smtp");
transport.connect(host, username, password);
transport.sendMessage(message, message.getAllRecipients());
This latter way is best when you need to send multiple messages, as it will keep the connection with the mail server active between messages. The basic send() mechanism makes a separate connection to the server for each method call.

Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic