Sending a Newsletter to 15,000 people - Problem: it stops before the end!

Hi everyone,
I'm trying to send a Newsletter to 15,000 people. I already have a solution using JavaMail and Servlets/Beans/JSP but it's ending before the end of the process... Here is a summary of the Servlet performing the sending:
// imports, etc.
private static final String recoveryAddressString = "[email protected]";
public void performTask(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
     java.sql.Connection connection = null;
     DatabaseConnection connBean = null;
try {
connection = ConnPool.getConnection();
connBean = new DatabaseConnection(connection);
connBean.setAutoCommit(false);
          java.util.Properties properties = System.getProperties();
properties.put("mail.smtp.host", Const.SMTP_SERVER);
Session session = Session.getDefaultInstance(properties, null);
// Calling several beans for making the Newsletter (date, articles, images, etc. = ...a lot)
     // Calling the bean "envoinewsletterdbbean" for getting the list of the 15.000 InternetAddresses, THEN:
for(int i = 0; ; ){
try {          
     String emailEnvoyeur = "[email protected]";
     String emailDestinataire = envoinewsletterdbbean.getEmail(i);                     
MimeMessage mimemessage = new MimeMessage(session);
// From:
     InternetAddress inetAddrEmailEnvoyeur;
try {
     inetAddrEmailEnvoyeur = new InternetAddress(emailEnvoyeur);
} catch (AddressException ae) {
// recovery address
System.out.println("***erreur email de l'envoyeur");
inetAddrEmailEnvoyeur = new InternetAddress(recoveryAddressString);
mimemessage.setFrom(inetAddrEmailEnvoyeur);
// To :                         
     InternetAddress inetAddrEmailDestinataire;
try {
     inetAddrEmailDestinataire = new InternetAddress(emailDestinataire);
} catch (AddressException ae) {
// recovery address
System.out.println("***Erreur adresse email du destinataire");
inetAddrEmailDestinataire = new InternetAddress(recoveryAddressString);
mimemessage.addRecipient(Message.RecipientType.TO, inetAddrEmailDestinataire);
mimemessage.setSubject(titreNewsletter);
String bodyText = "<html>";
bodyText = bodyText + "<head>";
//(... very long)
//(getting the text of the articles, images from the beans...)
mimemessage.setContent(bodyText, "text/html");
try {
     javax.mail.Transport.send(mimemessage);
} catch (Exception exception) {
     exception.printStackTrace();
     LogServiceTool.log("Exception lev\351e : " + exception, 1, getClass().toString());
     handleError(request, response, Const.pathWas_FO + Const.FO_error_page, exception);
i++ ;
} // exception at the end of theInternetAddress list...
catch (java.lang.ArrayIndexOutOfBoundsException _e0) {
System.out.println("***fin de la liste des expediteurs... sortie de la boucle");
break;
} //etc. END
MY PROBLEM IS: After something like 200 mails sent, I'm kinda logged out: "Response: no-url" in my JSP, because the operation is too long with my loop on the InternetAddresses, so far.
Is there a solution, like an independent "batch process" to perform the sending outside the session? Or is there a means using folders or different connections... ?
Thanks for your help...
Denis

One simple solution is to have the servlet start a new thread and allow the original one to respond to the client.
A better way of doing this is to have a stand alone application send the messages out. You can have it run manually or on a scheduler.
Don't use a jsp page as the trigger, and don't run the logic in the webserver, they were not designed to do these things in the way you want.

Similar Messages

  • Hello  Simple problem - don,t know how to solve it.  With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was de

    Hello
    Simple problem - don,t know how to solve it.
    With Premiere CC when I try to do a selection (click... drag... release the click) very often it stop way before the end of the move I'm swinging the Magic Mouse. I taught that the mouse clicking was defective and went to get a new Magic Mouse after lots of frustration. Today, I have an edit to do it it does the SAME thing !!
    I was like ????#$%?&*(???
    Opened all the lights and taught I've trow the new mouse to the garbage and was using the defective mouse again... no !! - ??
    Actually, the bran new mouse is doing the same thing. What I understand after investigating on the motion and watching carefully my fingers !! -  is that when I click I have to keep my finger at the EXACT same place on the mouse... drag and release and it's fine. If I click by pushing on the mouse and my finder is moving of a 1/32th of a millimeter, it will release and my selection will be to redo. You can understand my frustration ! - 75$ later... same problem, but I know that if I click with about 5 pounds of pressure and trying to pass my finger through the plastic of the mouse, it you stay steady and make it !
    The problem is that scrolling is enable while clicking and it bugs.
    How to disable it ??
    Simple question - can't find the answer !

    Helllooo !?
    sorry but the Magic Mouse is just useless with the new Adobe Premiere CC and since I'm not the only one but can't find answer this is really disappointing. This mouse is just fantastic and now I have to swap from a USB mouse to the Magic Mouse every times I do some editing. My USB mouse if hurting my hand somehow and I want to got back to the Magic Mouse asap. Please - for sure there is a simple solution !
    Thanks !!

  • I'm using mac with the newest operating system (snow leopard 10.6.7). since I've updated to Firefox 4 It doesn't display Hebrew fonts- I didn't have any problems with it before the upgrade and in safari I don't have this problem.

    Hello, I'm using Mac with the newest operating system (snow leopard 10.6.7). since I've updated to Firefox 4 It doesn't display Hebrew fonts… I didn't have any problems with it before the upgrade and in safari I have no problem with it. please help me- I don't like to use safari a my browser...

    elly903 wrote:
    Before commenting - I CANNOT install Mavericks because it'll mess up the versions of Filemaker Pro and Quicken that I use regularly...
    Quicken 2007 for Intel (Snow Leopard, Lion, Mt. Lion and Mavericks) for $15:
    http://quicken.intuit.com/personal-finance-software/quicken-2007-osx-lion.jsp
    It will input your Quicken PPC data file directly if it was Quicken 2005 through 2007.  If older you need Quicken 2006 or 2007 PPC first to convert your data file; and this update must be done BEFORE you upgrade to Mavericks:
    http://quicken.intuit.com/support/help/patching/quicken-2006-manual-updates--mac -/GEN82200.html
    Filemaker Pro PPC (in this case 7) running in Snow Leopard Server installed into Parallels for use in Lion, Mt. Lion and Mavericks:
                                  [click on image to enlarge]
    Snow Leopard Server: 1.800.MYAPPLE (1.800.692.7753) - Apple Part Number: MC588Z/A (telephone orders only)
    This solution allows you to run your Photoshop Elements in Mavericks concurrently with Filemaker Pro PPC.  Mavericks is a free download.

  • I use my new nano (7th gen) to listen to books on CD that i sync from my mac.  The problem is, it stops at the end of each CD.  How can I get it to continue on to the hanks, Wendy

    I use my new nano (7th gen) to listen to books on CD that I sync from my Mac.  The problem is that it stops at the end of each CD (very annoying).  How can I get it to continue on the the next CD?  Thanks, Wendy

    Have you tried a different pair of earbuds/headphones to rule out a pair of damaged/faulty ones?  You might also want to make sure the headphones are securely and firmly seated in Nano's headphone jack.  Lastly, check the headphone jack for any signs of debris or damage.  You may need to have the headphone jack replaced either by Apple or a third party repair company.
    I assume this static is present on any track you listen to versus only particular ones?
    B-rock

  • How to Send biulk mail  for 20,000 people with out blocking the mail server

    Hi .......... ALL
    I am developing a News module in our project, for this have to write code to send everyday news for 20,000 mail Ids
    I Developed a code that can send to one Id or multiple.
    Weather this type of mail sending treated as spam mail or blocking the mail server i did not know, any of one can please help me.
    If this type is not suitable then what is way to send bulk mails please guide me
    please help me......................
    BY Ramds
    MY Mail ID: [email protected]
    Edited by: ramdasteja on Oct 3, 2008 4:13 AM

    Hi .......... ALL
    I am developing a News module in our project, for this have to write code to send everyday news for 20,000 mail Ids
    I Developed a code that can send to one Id or multiple.
    Weather this type of mail sending treated as spam mail or blocking the mail server i did not know, any of one can please help me.
    If this type is not suitable then what is way to send bulk mails please guide me
    please help me......................
    BY Ramds
    MY Mail ID: [email protected]
    Edited by: ramdasteja on Oct 3, 2008 4:13 AM

  • Why is there no exchange program for people who bought ipad2 before the release date of ipad3

    I sold my iPad 64g 3g on 12 December 11 so I could buy and iPad 2 64g 3G iPad2 on Xmas then three months later ipad3 comes out I have been I contact with apple support and they tell me to sell it on the returns program they would offer me £300 for it I payed £700 with three years cover plan.
    I would have been happy to wait three months if I was notified that there was an iPad 3 release date but nothing came out .
    So I ask apple and you why is there no exchange program in place for new owners of iPad 2 to be able to exchange for iPad 3 this is good business for the support we give apple in buying they're products time after time

    Welcome to Apple Support Communities.
    Rhetorical Question: "Have you heard that juicy rumor about the 'iPad X' yet?"
    Apple, as a rule, does not announce hardware products far in advance of actual ordering availability.
    More importantly, the Terms of Service for users Apple Support Communities does not permit such speculation here.
    There were rumors and speculation about capabilities of the 'iPad 3' published online within hours of the release of the iPad 2 one year ago. If you want to 'keep up' with the rumors, I suggest taking few moments every month to visit websites like The Unofficial Apple Weblog (tuaw.com), and The Apple Insider (appleinsider.com), among others. You'll find a wealth of information about current products as well as plenty of rampant speculation about future products and projected release dates there.
    Regarding 'trade-in' or 'trade-up', Apple has built their organization to manufacture and market new devices, media, and software. As you discovered with your original iPad, the best solution may be to sell your current device privately and buy a new one if you have a compelling need to upgrade to the latest model.
    And, try as I might, I've never convinced my local car dealer to take my 3-month-old vehicle with 3,000 miles in equal trade for the shiny new model that was just introduced. But honestly, I'm buying run-of-the-mill 'daily transportation', not collectible automotive-works-of-art that will appreciate in value over time.

  • TS1567 Cannot download latest version of I-Tunes 11.1.4. It stops at the end with "Apple Mobile Device failed to start. Verify that you have sufficient privilege to start system services" never had a problem before. On Vista system. Come on Apple give us

    tried to download latest I-Tunes 11.1.4 update but got the message re " Apple Mobile  Device failed to start etc. Seems I am not the only one with this problem but getting frustrated as I have tried all the suggestions and now have no Itunes but plenty of money still on it. Why won't Apple admit they  have a problem and fix it. There is no where to complain to them online. Help please

    Hello PaulHeartattack,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Check for .dll files
    Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files.
    If you find QTMovie.DLL, or any other .dll files, move them to the desktop.
    Reboot your computer.
    Note: Depending on your operating system, you may only have one of the listed paths.
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    it may be necessary to remove all traces of iTunes and related software components from your computer before reinstalling iTunes.
    1. Remove iTunes and related components from the Control Panel
    2. Verify iTunes and related components are completely uninstalled
    3. Reinstall iTunes and related components
    If the Apple Mobile Device Service still will not start, this could be caused by third-party security software. Please follow iTunes for Windows: Troubleshooting security software issues.
    Best of luck,
    Mario

  • TS2755 I have to keep restarting my phone in order to send messages.  I didn't have to do this before the latest update:(

    I have to keep restarting my phone to be able to send messages ever since new update

    Hi - try this thread
    https://discussions.apple.com/message/23280703#23280703

  • Mac gets slowly and stops at the end. Reboot is necessary until next shutdown. What is the problem?

    I face the problem that since some week my iMac gets very slowly and stops working at a time. Any idea what I could do to avoid that
    thanks caparica

    Apple warns about using an older version pre-10.4.3, with later versions of Tiger. you should be able to just boot to Single User Mode and at the command prompt follow the directions for running
    /sbin/fsck -fy
    to repair the boot drive.
    Then, when you can, clone (backup your system) to another disk drive twice, once for your "working system" and another which is just your emergency system. That way, if, say 10.4.7 doesn't go as planned, you also have a backup.
    Sometimes you need a 3rd party utility like TechTool Pro, Disk Warrior, Drive Genius or something.
    Also, deleting the cache files/folders can help. And Applejack can be run along with fsck from S.U.M. (though I only use manual functions, and I never ever run it in auto mode).
    How about a Safe Boot by holding down the Shift key which would help rule out startup items or 3rd party extensions?
    If you do see power outages, and don't have UPS, that can help protect modem, ethernet port, and your system.
    Boot to Tiger DVD, use Disk Utility Restore, and copy your boot drive to another drive. Always have a backup before working on trying to repair a drive.

  • HT1222 10.6.3  everytime I try to upgrade to this ver. it stops at the end because it can't find the folder containing the information package "itunes.msi"  I have did a search for msi with no luck in finding it. has anyone have this problem with a soluti

    eerytime I try to upgrade to this ver. it stops at the end because it cant find the folder containing the missing "itunes.msi" has anyone else experienced this and is there a solution. help. Using XP service pack 3

    Download the Windows Installer CleanUp utility from the following page (use one of the links under the "DOWNLOAD LOCATIONS" thingy on the Major Geeks page):
    http://majorgeeks.com/download.php?det=4459
    To install the utility, doubleclick the msicuu2.exe file you downloaded.
    Now run the utility ("Start > All Programs > Windows Install Clean Up"). In the list of programs that appears in CleanUp, select any iTunes entries and click "Remove", as per the following screenshot:
    Quit out of CleanUp, restart the PC and try another iTunes install. Does it go through properly this time?

  • Problem in XI 30 with End-to-End Monitoring

    Hi people,
    I'm acceding to the End-to-End Monitoring in the Runtime Workbench.
    After I introduce all the data for monitoring messages and click
    Display.
    It shows the error:
    [code]java.lang.NullPointerException
         at com.sap.plaf.frog.FrogScrollPaneUI$1.propertyChange(FrogScrollPaneUI.java:113)
         at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
         at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
         at java.awt.Component.firePropertyChange(Unknown Source)
         at javax.swing.JScrollPane.setHorizontalScrollBar(Unknown Source)
         at javax.swing.plaf.basic.BasicComboPopup.createScroller(Unknown Source)
         at javax.swing.plaf.basic.BasicComboPopup.<init>(Unknown Source)
         at com.sap.plaf.frog.FrogComboPopup.<init>(FrogComboPopup.java:21)
         at com.sap.plaf.frog.FrogComboBoxUI.createPopup(FrogComboBoxUI.java:410)
         at com.sap.plaf.frog.FrogComboBoxUI.installUI(FrogComboBoxUI.java:178)
         at javax.swing.JComponent.setUI(Unknown Source)
         at javax.swing.JComboBox.setUI(Unknown Source)
         at javax.swing.JComboBox.updateUI(Unknown Source)
         at javax.swing.JComboBox.init(Unknown Source)
         at javax.swing.JComboBox.<init>(Unknown Source)
         at com.sap.jnet.clib.JNcToolBar$ComboBox.<init>(JNcToolBar.java:64)
         at com.sap.jnet.clib.JNcToolBar.addComboBox(JNcToolBar.java:192)
         at com.sap.jnet.clib.JNcAppWindow.newUI(JNcAppWindow.java:538)
         at com.sap.jnet.clib.JNcAppWindow.newData(JNcAppWindow.java:966)
         at com.sap.jnet.JNetData.createGraphFromDOM(JNetData.java:488)
         at com.sap.jnet.JNetData.load(JNetData.java:674)
         at com.sap.jnet.JNetData.load(JNetData.java:710)
         at com.sap.jnet.JNetApplet.init(JNetApplet.java:545)
         at sun.applet.AppletPanel.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    [/code]
    The version of my JVM is: build 1.5.0_08, but also I have test in
    another computer with version 1.4.2_12 of the JVM. Additionally, the
    version of JAVA Web Start is 1.0.1_02.
    What could be happening?
    Is a problem with my clients??? Is a problem with .jar????
    Kind regards,

    Himadri,
    In the exchange profile the port and host name are correct.
    Venkat,
    Yes, it shows the log-in pop up and I have access to the next window (it's divided in two parts, to the left I select the values; and to the right with the client java). But before acceding this window, it shows the error that I comment and the right part shows "JNET Aborted...".
    If I press “Start Selection”, the java client try to load and shows the same error.

  • Odd problems exporting videos: dropped frames, end glitches

    Having some strange things happening on the work computer (which is a pre-intel MacPro running Leopard and latest version of FCP). In the last couple of weeks we've been having a lot of files that we're trying to export (by either directly playing them or "Print to Video" via Firewire to a Sony DV/Cam deck, which in turn passes it through to a Beta machine). The videos have been freezing up or giving "Dropped Frame" error messages. To combat the problem I've exported the videos (usually 10 minutes in length) to Quicktime Movie file, and then ran that file (thus making it one big file instead of 40 or so cuts/insertions, etc).
    Dropped Frames ceased to be a problem, and it plays smoothly...but now when we get to the end, we get a weird white glitch. Figured it might want a fade out to smooth out the end of the file (even though it already had a fade out) but now the file is freezing up right before it gets to the fade out.
    The really odd thing is, it looks and acts fine when I play from 5 seconds or so before the end of the clip. It's only playing it in its entirety that the end acts up.
    I'm at my wit's end figuring out options. I've rebuilt permissions, restarted the computer, done a disc utility diagnostic/repair disc. I've deleted the preferences for FCP.
    Open to any suggestions!
    Thanks

    No, I'm not using assembly mode.
    The really odd and frustrating thing is that haven't done anything different that I haven't done with hundreds of similar projects. But all of a sudden things are happening (mentioned the dropped frames problem in case it is linked. Increasingly I've been having projects stop printing/playing due to dropped frames with no consistent possible reason, in terms of materials used, transitions, hard drive, etc.). No change of equipment or software (other than updates).
    My boss complained about the white 'glitch' happening a couple months or so ago, and thought it was due to forgetting to do a fade-out at the end, but that doesn't seem to be the case.

  • Suddenly I can't send to more than about 25 people in one email. I used to be able to send to 100+, no problem. What happened?

    For years I have sent an email to all teams in my cricket club by simply adding each separate group list to the 'cc' or 'bcc' list and pressing send, thus sending the same mail to 100+ people simultaneously, no problem. Suddenly the system says I am trying to send it to 'too many recipients'. I even had to split some of the group lists in to two separate group lists because it seems that the maximum number of people I can send one email to is now about 20 people. This is a problem especially that sometimes players would comment on the email and wish to include everybody in the club, so would use the 'reply all' function. Now they can only reply to those on the same email list as them, which sometimes isn't even all of their own team...
    Club leaders are on more than one of the team lists, so some people now have to receive the same email in their inbox up to 5 times due to this problem.
    There were no changes at all made to anything else with my system: same server, same computer, same emails, same everything. It just happened one day to the next.

    Any limit is imposed by whatever SMTP server you use. So talk to your email provider.
    With that number of recipients it would probably be a good idea to look for a mailing list service.
    http://www.idealware.org/articles/fgt_email_newsletter_tools.php

  • When I send a newsletter as a pdf the photos are blurry.

    When I send my newsletter made with Pages as a pdf the photos all look very blurry. I tried larger size files and same problem. I sent the original template with the Apple default photos and they are blurry as well. I've only looked at them on our two computers, both Macs. I size my photos no larger than 800 pixels on the longest side @72dpi. I have received a pdf newsletter made with Pages from someone else, and the photos look fine.

    Are you using the shadow tool in your document ?
    Yvan KOENIG (VALLAURIS, France) jeudi 30 juin 2011 11:16:25 iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Problem Unable to convert the sender service to an ALE logical system

    Hi to All..
    I'm facing a problem in one scenario File to Idoc .. I got this problem
    "Unable to convert the sender service to an ALE logical system" in pipeline Call Adapter.
    I check this blog but the problem persist . /people/michal.krawczyk2/blog/2005/03/29/xi-error--unable-to-convert-the-sender-service-to-an-ale-logical-system
    Also I have another scenario in other Software Component Version SCW  and the Idoc works correctly..
    I wonder if I miss something
    this the trace
      <Trace level="1" type="T">----
    </Trace>
    - <Trace level="1" type="B" name="CL_IDX_IDOC_SERVICE-ENTER_PLSRV">
      <Trace level="1" type="T">Pipeline Service ID: PLSRV_CALL_ADAPTER</Trace>
      <Trace level="1" type="T">Get Information from IS-Header Objekt</Trace>
      <Trace level="1" type="T">Get Information from SD-IDoc-Endpoint</Trace>
      <Trace level="1" type="T">Sender and Receiver after Header-Mapping</Trace>
      <Trace level="1" type="T">Sender service Sys_XXX</Trace>
      <Trace level="1" type="T">Receiver service Sys_EDV_XXX</Trace>
      </Trace>
      </Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_LOG_TO_PERSIST" />
      <Trace level="1" type="System_Error">Error exception return from pipeline processing!</Trace>
      <Trace level="1" type="B" name="CL_XMS_MAIN-WRITE_MESSAGE_TO_PERSIST" />
    Edited by: Luis Ortiz on Jan 25, 2010 3:37 PM

    Hi,
    in order to use only one logical system (PI's) in we20 in ECC and not as many as you have sender systems
    Regards,
    Michal Krawczyk

Maybe you are looking for

  • Double Click on Magic Mouse No Longer Works after 10.9.1 Mavericks Upgrade

    I just recently updated to Mavericks 10.9.1 and once the computer restarted, I noticed that double-click on my Magic Mouse no longer worked.  I searched the forum and couldn't find anyone experiencing this.  I also went into System Preferences --> Mo

  • View of values in nested table attribute of object type

    Hi, I have:create or replace type ctx_line is object (   ctx_name  varchar2(40),   ctx_value varchar2(1000) create or replace type ctx_tab is table of ctx_line; create type tp as object (   id      number,   ctx     ctx_tab create table tt of tp nest

  • Music App crashes often

    I have an iPod touch 3G and about 1800+ Songs on it. My iPod app often crashed after syncing, so I turned off audiobooks and podcasts . Now I have a big problem: I haven't synced since about 1 month and iTunes just let me restore my iPod. So all of t

  • RFC - to get the Details

    Hi SDN        I've created a RFC which will update six different ztables with key as Purchase requisition number. The inputs for the tables are paased through the Input parmeters and the Ztable are getting succesfully updated. Now the questions is ..

  • System refresh in MSSQL

    Hi Folks,     We are planning to do a refresh from "AA" system to "BB" system.But "AA" system consist of only two drive like  C drive consits fo USR data and D drive consists of AAdata1,AAdata2,AAdata3,AAlog. Now "BB" System consists of 4 drives whic