Problem sending a mail to many adresses with attachments (Javamail, JSP)

Hi,
i got a problem with JavaMail trying to send a mail to different email-adresses in a JSP. The mail should be send to about 27 adresses, which works fine whenever i send it without any attachments. As soon as i attach a file, the mail still gets send without an error, but only to about 12 adresses instead of the intended 27. I get the adresses out of a database and in either case, there ist the correct amount of adresses. The Mailserver doesnt report anything - it sends the mails without any problem at the 12 adresses.
Here is the part of the code, thats sending:
Properties props = new Properties();
props.put("mail.smtp.host", "192.168.1.1 ");
Session s;
MimeMessage message;
InternetAddress from = new InternetAddress("[email protected]");
InternetAddress to;
s = Session.getInstance(props,null);
Transport trans=s.getTransport("smtp");
//get adresses from db
while (rspartner.next())
     to = new InternetAddress(rspartner.getString("postfach"));
     message.addRecipient(Message.RecipientType.TO, to);
     empfaengerzeile=rspartner.getRow();
     //out.println(empfaengerzeile+" --- "+rspartner.getString("postfach")+"<br>");
     BodyPart messageBodyPart=new MimeBodyPart();
     messageBodyPart.setText(nachricht);
     Multipart multipart=new MimeMultipart();
     multipart.addBodyPart(messageBodyPart);
     //Dateinamen und Speicherort des Plan ermitteln
     queryAnhang=dbCon.prepareStatement("select pfad from m_baukoord_kommentar where baukoord_id=? and titel='Entwurfsplan'");
     queryAnhang.setString(1,request.getParameter("projektid"));
     rsanhang=queryAnhang.executeQuery();
     rsanhang.next();
     datei=rsanhang.getString("pfad");
     //Datei zippen
     quellpfad+= ebaukonr.trim() + "/" + datei;
     if(datei.contains("."))
          zipfilename=datei.substring(0,datei.lastIndexOf('.'))+".zip";
     else
          zipfilename=datei+".zip";
     zielpfad=config.getServletContext().getRealPath("")+"/strasse/UserDownloads/" + zipfilename;
     ZipOutputStream zipout = new ZipOutputStream(new FileOutputStream(zielpfad));
     zipout.setLevel(9);
     zipout.setMethod(ZipOutputStream.DEFLATED);
     FileInputStream in = new FileInputStream(quellpfad);
     zipout.putNextEntry(new ZipEntry(datei));
     int len;
     while ((len = in.read(buf)) > 0) {
         zipout.write(buf, 0, len);
     zipout.closeEntry();
     in.close();     
     zipout.close();
     //Datei anhaengen
     messageBodyPart = new MimeBodyPart();
     FileDataSource source = new FileDataSource(zielpfad);
     messageBodyPart.setDataHandler(new DataHandler(source));
     messageBodyPart.setFileName("Entwurfsplan.zip");
     multipart.addBodyPart(messageBodyPart);
     message.setSubject("Neues Projekt " + titel + " verfügbar");
     message.setContent(multipart);
     trans.send(message);

With active debug i got following information:
The first mail in the debug-log is with the source code as quoted in my first post, the second mail is when i cut out the part which generates and adds the attachement. I had to make the adresses anonymous, but the second mail contains a lot more adresses then the first, although they both use the same query with same parameters, etc.
Have i done something wrong with the attachements? Overwriting headers, syntax errors, anything? I'm out of ideas...
edit: Had to cut out the debug-log because it is too big. It just said that everything was working ok, but the first mail contains too few adresses and the second (without attachement) the correct number of adresses. I can mail the log, if you like.

Similar Messages

  • Is anyone else having a problem sending a mail message with PDF attached?

    Is anyone else having a problem sending a mail message with PDF attached? I receive the following message:
    Sending the message content to the server failed.
    Select a different outgoing mail server from the list below or click Try Later to leave the message in your Outbox until it can be sent.
    Is there a fix for this?

    Anyone?  I was hoping my problem would just 'fix itself'...  but I still have some clients telling me they're not receiving any email from me.  I've since deleted that account on my computers and re-added it.  But still having the same issue. 

  • Problems sending/eceiving mail

    The last month or so I've been having problems sending/receiving mail thru the Apple mail app. the error message is something like, error sending mail, try with another client? Comcast is my mail server, but I also have my Google account accessible thru mail, so I use that to send. I can definitely work around this, but am wondering what I might do to fix it?
    Message was edited by: lbell

    I have the identical issue with comcast and mail (...) it's really not their issue - I'm sure it's the mail app
    Really? What makes you so sure? I've had no problems connecting to any mail servers (within allowed use limits imposed by the server, like not sending from outside their network) using Mail, and I've used it over the years with Earthlink, Adelphia, RoadRunner, GMail, pair.com and Mac.com (those are the ones I remember). If multiple people are having problems with Comcast+Mail, chances are better that Comcast is doing something a little on the edge of dodgy than that Mail is doing something wrong that only shows up with Comcast servers.

  • Having problem sending e-mails.  There's a message on the screen saying that "the sender address was rejected by a server.

    I'm having problem sending e-mails.  There's a message on the screen after I press send saying that "The sender adress was rejected by a server.

    Check the outgoing mail server setting. Make sure that your username and password are in there.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

  • TS3899 My iphone has had problems sending e-mail via my 1&1 e-mail account

    My iphone has had problems sending e-mail via my 1&1 e-mail account for the last two days.  I get a 'recipient rejected by the server' message.  I have not changed any settings.  If I change the from address to i-cloud the e-mails go.  Advice please.

    i think you need to contact your email provider - that sounds like an issue on their end and nothing to do with your phone.

  • Ipad2 not sending e mails they just disappear no comments no problem sending e mails on gmail

    IPad 2 will not send emails just disappear no response no problem sending e mails using g mail

    Have you checked your configuration against the official settings?
    http://mail.google.com/support/bin/answer.py?answer=78799
    The account name is to include the "@gmail.com" part.

  • I have problems sending e-mail from my iPhone.  I can receive OK.

    I have problems sending e-mail from my iPhone.  I can receive OK.  The e-mail gets put in the outbox, but never goes out.

    Did you set it up following this:
    http://portal.activehost.com/knowledgebase.php?action=displayarticle&id=4744

  • Problem Sending Verizon Mail Using Mail Program

    I have not had a problem sending Verizon mail from my Mail program prior to Mavericks.  Now it is giving me fits. I do not have any troubke receiving mail. 
    This is what I get when I try and send mail through my Verizon account.  Do I just check Always Trust and then Connect.  There have been no Certificate issues prior to Maverick.  What is going on?   I did not get anything like this yesterday before I upgraded to Mavericks.

    This is what I get when I try and send an e-mail using my Verizon account in mail.
    Message was edited by: Stamper

  • Sending a mail from Orale APEX with File Attachments

    Hi All,
    I want one solution, i need to send a mail from my application with HTMLDB_MAIL.SEND package and i need to know wheather we can send a mail with file attachments in APEX,if it is possible then how can i send,Can any body please help me with this.
    Thanks

    dil84 wrote:
    Hi All,
    I want one solution, i need to send a mail from my application with HTMLDB_MAIL.SEND package and i need to know wheather we can send a mail with file attachments in APEX,if it is possible then how can i send,Can any body please help me with this.
    ThanksEmail attachments arrived with Apex version 3.1.

  • Once again, I have problems sending e-mails from my iPad 2. I have a telus account and I have dealt with their tech people and they have checked all my settings and everything is fine. Apple techs advised to open Gmail acct. and re-route through it? Why?

    I am having a difficult time trying to send e-mails from my iPad 2? I have contacted my Telus server tech people and we have double checked all my settings. Everything is properly set! Checked with my Apple people and they say this is a common problem with my server, yet others with the same server don't seem to have a problem. They suggested that I open a Gmail account and infor my mail server(Telus) to route my mail through my Gmail account? Does thei make sense? Are ther any other solutions I might investigate?

    Hi prettytoni,
    I saw one interesting solution to set a gmail account like as it is a "Microsoft Exchages" account... Maybe you can try to do the similiar with your Telus account? (I'm not sure about the result, but still you can try it))))
    here is the link:
    http://www.maclife.com/article/howtos/how_set_your_gmail_accounts_push_email

  • Problem Sending E-mails with Outlook 2007

    We have multiple e-mail addresses here at my office, all on the same server, same domain, etc. 2 users are unable to send e-mails, but can receive just fine. The e-mails they send are showing in the "sent folder"; however the recipient never receives
    the e-mail, and there are no error messages! My e-mail, again it's associated with the same domain and server, works just fine, I can send and receive e-mails all day. The ports are correct, the settings are correct, I have checked EVERYTHING! I have even
    deleted those 2 e-mail accounts and set them up again as new accounts, and no luck still. PLEASE ADVISE!!!
    Thank you!

    Hi,
    What about when using Outlook Web App [OWA] or Outlook in Online Mode? See if they have any anti-virus software components integrated with Outlook, disable them and verify result.
    Regards,
    Ethan Hua CHN
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • We had broadband with BT and I had no problem sending e-mails. We then changed to TalkTalk  and I cannot send any e-mails and do not understand why. can anyone help? We are not techy at all and struggle when things go wrong.

    We used to have BT as our broadband provider and then switched to Talk Talk. Since the switch we cannot send e mails although we are receiving them on the old address. We don't understand what has gone wrong. Can anyone help?
    Thank you
    Ellie

    You need to contact T-T and find out their SMTP settings ( which allows the sending of emails over wifi via your ISP) This info is probably on their website
    I assume you do not have a 3G iPad .In which case go to  the Apple site
    http://www.apple.com/support/ipad/
    where you should find very clear guidance on most issues

  • When trying to send a mail, selecting attachement fails with no error.

    I imported lots of folders form Kmail (KDE3.5/ trinity) on a previous version (don't remember which one) of Thunderbird.
    All worked fine. (I was able to send a variaty of files in email attachements (.xls, .zip, .txt and also files with no extension with no trouble)
    Somewhen two weeks ago I updated Thunderbird and it would not allow me to attach files to a mail I want to send.
    This means: --click on the button to send a new mail.
    --typing a email adress
    --typing a subject
    --typing 'hello' into the text field
    --clicking the button to attach a file
    --selecting a text file, picture, .zip, binary and click 'open' in the file selector
    == nothing changes in the email window to show that a file has been attached and also on sending the mail the receiver does not receive a mail.
    reverting to older version of thunderbird does not seem possible as it appears that there is no link to older packages on thunderbird downlaod site?
    where did I go wrong?

    I doubt it's a version problem. But I don't run Linux any more.
    Old versions can be found here:
    http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/

  • Problems sending ISP mail on mac

    I wonder if anyone can help me with a Mail issue.  I'm using my own domain's email address in Mail,and am experiencing an unusual problem.  I'm able to both send and receive email, but should I send an email, and then receive a reply, I can't send a further reply unless I shut down Mail, and then reopen it.  It then sends just fine.  The error message I receive says "Cannot send message using the server mail.xxxxxx.co.uk"  It then suggests I verify the server settings, but I know these are correct as I've double and triple checked them, and contacted the support guys from my hosting service, who have confirmed they are set correctly.
    What happens is I always have to select "Try Later" in the error message, close down Mail, reopen it, at which point the same error message pops up, only this time I select "Try with selected server", which is the same one that earlier refused to send it, and it sends without a problem.  I can then send as many emails as I like, but as soon as I receive a reply from someone, I have to go through the whole process again.  I don't have this problem with my mac.com emails, they send just fine.
    Any ideas?  I'm at a loss, and I really don't want to switch to another email client, as I like Mail.

    i am having similar issues.
    Is the problem on APPLE side or our side. I cannot send any mail.

  • Problem sending AOL mail in Mail 2.1.1

    I just switched from using the AOL mail program to the Mac Mail program for sending and receiving AOL mail. It worked flawlessly for 2 weeks. Then, suddenly yesterday I could only receive AOL mail, I could not send. I have scoured the Apple discussions and Googled the web for any causes of this problem, but cannot find a reason.
    Anyone else having this problem? I have checked and rechecked my settings in Mail preferences. I have deleted and re-added the AOL account.
    What is odd is that every once in a while I can send a few test messages and then it stops working again. I know, I hate AOL, but for various reasons I have to keep the account.
    Thanks,
    Sue

    Not sure how you missed it - the answer for Susan is in her previous post.
    However, I tried something else this morning and it worked. Since I have a Broadband connection thru my cable company, I set it as the smtp server for sending mail and that worked. It is invisible to the recipients, in other words, the From in the header to recipients still says it's from my AOL.com account.
    If you have confirmed AOL's authenticated SMTP server settings using Port 587 which recently stopped working, depending on the error message provided more than likely your internet service provider made a change in regards to using an SMTP server that is outside of their network.
    If you are also accessing an email account and SMTP server that is provided by your ISP used for connecting to the internet with Mail and there are no problems sending messages with this account and SMTP server, select/use your ISP's SMTP server to send messages with your AOL account which can also be used to send messages with any email account that is not provided by your ISP.
    If not, add your ISP's SMTP server to Mail as an available SMTP server to select/use for sending messages with your AOL account.
    This was/is Susan's solution and the solution required by many depending on their ISP's restrictions.

Maybe you are looking for

  • External link issues with FF7+

    Hello, after updating to FF7 (and now 7.01) most external links (widgets, etc.) are not displaying. Such as the twitter and facebook widgets. They won't display. Also on twitter, the right column thumbnails of photos (twitpic, etc.) are not displayin

  • Odd sound from 24-inch LED in sleep mode

    Hello. I got the new 24-inch LED Cinema Display about a week ago. Looks awesome. Noticed an odd sound though that comes from the display when my MacBook Pro goes in sleep mode and only then. It's not extremely loud but is high pitched and is emanatin

  • Using flash drives for long-term backups

    I use a USB flash drive to backup my mom's iPhoto Library. I've heard, however, that flash drives are not reliable for long-term backups. Is this true? If so, what is the best alternative?

  • Bridge talk for InDesign CS4/CS5 js

    Hi, Have this code that opens file in Ph and resaves it in different format. In this case I need to adjust it to open pdf file in photoshop and set crop to media box. It works with pdf files as is, but if there is white space around artwork, it gets

  • ITunes window shortcuts don't work

    Command-1 and Command-2 do not work to bring up the iTunes and Equalizer windows, respectvely.