Java Mail: send a SINGLE email to a distribution list

Is it possible to send a single email to a distribution list using Java Mail?
Please help with some code samples.
Right now, our mail program uses java mail api to send one email/person in the distribution list and runs in a for loop. Is it possible to have the distribution list in the to field and just send one single email to all persons in the list?
Thanks,
Jayashree.

Yes, of course, assuming your mail server supports
distribution lists. Most mail servers do, but exactly
how you create and administer a mailing list varies
from server to server.
Once you've created the mailing list on the server,
just use the name of the list in the To field of the
message.

Similar Messages

  • Leave mails send to specefic email adresses on the server?

    I have several email adresses at my mail account, but for different users. I want Mail just to download my emails (send to my email adress) and leave the rest (send to other email adresses, but on same account) on the server.
    In Windows Mail I could put up a rule for the program not to download mails send to specefic email adresses from the server, but this doesnt seem to be an option in the Mail on the Mac OS. Any solution for this?

    Firefox doesn't do email, it's a web browser.
    If you are using Firefox to access web mail, you need to seek support from your service provider or a forum for that service.
    If your problem is with Thunderbird, see this forum for support.
    [http://www.mozillamessaging.com/en-US/support/]
    or this one
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • Cannot email recreated dynamic distribution list NDR 5.1.1

    We had an issue where we needed to change the location of the OU in a dynamic distribution groups that had moved from Exch 2003>2010>2013.  We couldn't do it so we recreated a new distribution group with the same SMTP address.  Now users
    are getting 5.1.1 errors when trying to send an email to the distribution list.
    Here is the error: 
    IMCEAEX-_o=Wa-Nee+20Community+20Schools_ou=First+20Administrative+20Group_cn=Recipients_cn=[email protected]
    Remote Server returned '550 5.1.1 RESOLVER.ADR.ExRecipNotFound; not found'
    I have found other posts that mention deleting the cached address in Outlook, but that has not solved my issue.  Further reading leads me to believe it might have something to do with the legacy DN, but I don't know what to do to fix the issue.

    I convered it to this: X500:/o=Wa-Nee Community Schools/ou=First Administrative Group/cn=Recipients/cn=[email protected] and added as an X500 address in the newly created dynamic dist group, but I am still getting the NDR.
    IMCEAEX-_o=Wa-Nee+20Community+20Schools_ou=First+20Administrative+20Group_cn=Recipients_cn=[email protected] Remote Server returned '550 5.1.1 RESOLVER.ADR.ExRecipNotFound;
    not found'
    That OU (First Administrative Group) isn't an OU I am using.  Is it possible that the legacy DN value is pointing to the old dynamic group location and I need to update to point to the new location of the distribution group?

  • How do I set up an email group (aka distribution list) on iPad Air

    How do I set up an email group (aka distribution list) on iPad Air?

    It wasn't clear what the diff was between the 2 versions. I got the impression, from some reviews, that the free version limited the number of groups you could have, or the number in each group. Anyway, after all the hours I've spent over the last few days trying work-arounds, it was well worth 4 bucks.

  • Exception in java mail API when parsing email

    I am receiving the following exception when receiving some emails that contain attachments with java mail (irrelevant part of stack trace omitted):
    javax.mail.internet.ParseException: Expected ';', got ","
         at javax.mail.internet.ParameterList.<init>(ParameterList.java:289)
         at javax.mail.internet.ContentDisposition.<init>(ContentDisposition.java:100)
         at javax.mail.internet.MimeBodyPart.getFileName(MimeBodyPart.java:1136)
    The header of a message the causes the problem is:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) ------------ Message headers ------------
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Received: from mail2.uscourts.gov ([10.170.250.2])
    by ushub06.uscmail.dcn (Lotus Domino Release 8.5.2FP1 HF3)
    with SMTP id 2011042514392620-733724 ;
    Mon, 25 Apr 2011 14:39:26 -0400
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Received: from (unknown [63.174.91.123]) by avms-usc-04c-02vh.ibmta.uscourts.gov with smtp
         id 191c_067d_57fad3b8_6f6b_11e0_8de9_00265519f638;
         Mon, 25 Apr 2011 18:39:24 +0000
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) X-WSS-ID: 0LK815L-05-67D-02
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) X-M-MSG:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Received: from kcmexclaim.Our-Firm.com (unknown [10.42.5.222])by mail4.stinson.com (Axway MailGate 3.8.1) with ESMTP id 27239A12C1D;     Mon, 25 Apr 2011 13:39:20 -0500 (CDT)
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Received: from KCME2K7-HUB02.Our-Firm.com ([10.42.5.19]) by kcmexclaim.Our-Firm.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 25 Apr 2011 13:39:23 -0500
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Received: from FIRMCMS01.Our-Firm.com ([fe80::81d0:dd2b:9983:1126]) by KCME2K7-HUB02.Our-Firm.com ([::1]) with mapi; Mon, 25 Apr 2011 13:39:22 -0500
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) From:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) To:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Cc:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Disposition-Notification-To:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Date: Mon, 25 Apr 2011 13:39:21 -0500
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Subject: Order Regarding Application To Employ SMH as Debtor's Counsel
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Thread-Topic: Order Regarding Application To Employ SMH as Debtor's Counsel
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Thread-Index: AcwDb/bpRQlxt/eTQC6BA7G10hdWJQAB99vQ
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Message-ID: <[email protected]>
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Accept-Language: en-US
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) X-MS-Has-Attach: yes
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) X-MS-TNEF-Correlator:
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) acceptlanguage: en-US
    2011-04-25 14:39:48,060 INFO [STDOUT] (WorkManager(2)-97) Importance: Normal
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) Priority: normal
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4841
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) MIME-Version: 1.0
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) Return-Path:
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) X-OriginalArrivalTime: 25 Apr 2011 18:39:23.0526 (UTC) FILETIME=[18E10260:01CC0378]
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) X-MIMETrack: Itemize by SMTP Server on USHUB06/H/US/USCOURTS(Release 8.5.2FP1 HF3|December 21, 2010) at 04/25/2011 02:39:26 PM, Serialize by POP3 Server(Release 8.0.2FP3 HF28|December 28, 2009) at 04/25/2011 02:39:47 PM
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) Content-Transfer-Encoding: 7bit
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) Content-Class: urn:content-classes:message 2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) Content-Type: multipart/mixed;     boundary="_004_52835C1F7A6C8D4F989C433DCC611CA06F252D6682FIRMCMS01OurF_"
    2011-04-25 14:39:48,061 INFO [STDOUT] (WorkManager(2)-97) Content-Language: en-US
    the client/OS combination of the mail sender is Windows XP service Pack 3/Outlook 2007 , Java Mail version 1.4.3
    Any help would be appreciated
    Edited by: 854778 on Apr 26, 2011 8:28 AM

    The exception is occurring when parsing the Content-Disposition header.
    I don't see that header in the list of headers you provided.
    Can you save the entire message to a text file using
    msg.writeTo(new FileOutputStream("msg.txt"));
    Then look for the Content-Disposition header in msg.txt. Most likely you'll
    find that it is incorrectly formatted - as the exception says, there's a comma
    in a place that a semicolon is expected.

  • How many people can I send a single email to

    I used a smart group in Address Book to send a BCC email to using "Mail".  I get a error message that says the recipients are not valid, but I know their addresses are.  Im assuming that the # of recipients in the BCC field are too big.  What is the capacity I can send? 

    Apple Mail probably has no limit, but in addition to any limits that may be set by your service provider, emails with very long lists of addresses (like hundreds or thousands) may be filtered as potential spam by some of your recipients' mail servers. If you are concerned about the number of recipients you can use a mailing list service like Constant Contact or Campaign Monitor that can help format emails so that they avoid tripping spam filters.
    But if you are getting an error message about validity, it is probably not about a numerical limit. It is more likely to mean that one or more of the addresses is not formatted correctly, like a letter or symbol is mistyped in a contact record in Address Book.

  • TS3899 I have a new IPad and am trying to send a new email from my contact list with photos attached.  No success.  I can reply to an email ok.  But cannot attach a photo from my pictures.

    I cannot send an email from my contact list and attach a photo from my pictures.  I can reply to emails I have in my inbox BUT i cannot find where I would attach a picture there.

    Since you are a new iPad user .....
    Complete guide to using iOS 6
    http://howto.cnet.com/ios-6-complete-guide/
    Guide to Built-In Apps on iOS
    https://sites.google.com/site/appleclubfhs/support/advice-and-articles/guide-to- built-in-apps-ios
    You can download a complete iOS 5 iPad User Guide and iOS 6 iPad User Guide here: http://support.apple.com/manuals/ipad/
    Also, Good Instructions http://www.tcgeeks.com/how-to-use-ipad-2/
    Apple - iPad - Guided Tours
    http://www.apple.com/ipad/videos/
    Apple iPad Guided Tours - Watch the videos see all the amazing iPad apps in action. Learn how to use FaceTime, Mail, Safari, Videos, Maps, iBooks, App Store, and more.
    http://www.youtube.com/watch?v=YT2bD0-OqBM
    http://www.youtube.com/watch?v=ROY4tLyNlsg&feature=relmfu
    http://www.youtube.com/watch?v=QSPXXhmwYf4&feature=relmfu
    How to - Articles & User Guides & Tutorials
    http://www.iphone-mac.com/index.php/Index/howto/id/4/type/select
    iPad How-Tos  http://ipod.about.com/lr/ipad_how-tos/903396/1/
    You can download this guide to your iPad.
    iPad User Guide for iOS 5
    http://itunes.apple.com/us/book/ipad-user-guide-for-ios-5/id470308101?mt=11
     Cheers, Tom

  • Sending concurrent program output as an Email to a distribution list

    Hi Oracle Gurus,
    We have a unique requirement wherein we need to send the output of a Concurrent Program as an attachment with an mail to a Distribution list . Can someone please let me know if there is any provision within Apps to accomplish the same.
    Regards
    Kiran

    Hi ,
    COncurrent prorams is for Reports ?
    if so try with solution.
    write a unix script. or this purpose.
    Something in the order of this should work. You get the idea.
    1. Define printer styles
    2. Define a printer driver to call script in the arguments field:
    $ZZ_TOP/bin/email.sh $PROFILES$.FILENAME
    $PROFILES$.USERNAME $PROFILES$.TITLE
    3. Assign printer to the print styles and the driver
    4. Register the e-mail printer
    5. Default your report use the e-mail printer
    # Example script email.sh
    #!/bin/ksh
    [email protected]
    mailx -s "$3" $email_addr $1
    exit 0
    $1 is $PROFILE$.FILENAME
    $2 is $PROFILES$.USERNAME
    $3 is $PROFILES$.TITLE
    try with this u will get some idea.
    just let me know after you done it.
    --Basava.S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to send a broadcast message to public distribution list?

    I set up a Pulic distribution list in Unity system, but what extension number should I dial to send a publick distribution list? What is the public distribution list number?
    Thanks for any input.

    Log to Unity (press the Messages button and type your password). It will prompt you what is the button that you need to press to send a message (by default is 2), press that number, now it will prompt you to spell the name of the person or the distribution list. You can press ## (# key twice) to change to enter the extension.
    If you go to the SAWEB and search for your Distribution List you will see that you can add and extension.
    So by following the above instruction you can send a message by spelling the name of the DL or entering the extension of the DL.
    HTH
    //Jorge

  • Not receiving email sent to Distribution List?

    Hi all
    My client has a 8900, for which I have set up Exchange email via BIS.
    Everything works ok except the blackberry doesnt sync any messages sent to distribution lists he is part of.
    Outlook mailbox is working fine, showing all emails.
    I'd imagine this is a common question but the search is throwing up an error and I cant find an answer!

    did you found solution for this one I've got similar issue
    exchange 2007, emails sent to distribution group are fine in outlook but not on the Blackberry device, all other emails on the device works fine ...

  • Java.mail sending email in html format

    I trying to send emails from my java program, I ve managd to send text mails, I want to send email in html format is there a way of doing that and how
    thanks for your help

    Thanks a lot it is working now but I think that sending mails in text format is the best way since there isn't a way of knowing whether the recepient can handel html mails

  • URGENT -java MAil sending pdf as attachment

    I have a small java program that sends the pdf as an attachment without using phisical pdf file.
    but the problem is i am unable to open the pdf that comes as as attachment in mail.
    error while opening pdf : " acrobat cannot open file bcos the file type is not supported or the file is curropted(for example it was sent as email attachment and was not properly decoded)"
    here is the code :
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import java.io.*;
    import java.util.*;
    public class Mailer {
    public static void main (String args[]) {
    String host = "abc";
    String from ="[email protected]";
    String to = "[email protected]";
    //String fileAttachment = args[0];
    // Get system properties
    Properties props = System.getProperties();
    // Setup mail server
    props.put("mail.smtp.host", host);
    // Get session
    Session session =
    Session.getInstance(props, null);
    // Define message
    MimeMessage message = new MimeMessage(session);
    message.setFrom( new InternetAddress(from));
    message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setSubject("Hello JavaMail Attachment subject");
    // create the message part
    MimeBodyPart messageBodyPart = new MimeBodyPart();
    //fill message
    messageBodyPart.setText("Hi hello this is the msg in mail");
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    messageBodyPart = new MimeBodyPart();
    String data_to_send = "This msg is sent as an attachment with out using physical file";
    String att_type = "application/pdf";
    messageBodyPart.setText(data_to_send);
    messageBodyPart.setHeader("Content-Type", att_type);
    messageBodyPart.setHeader("Content-Transfer-Encoding", "BASE64");
    messageBodyPart.setFileName("attachment.pdf");
    /* ByteArrayOutputStream byteStream=new ByteArrayOutputStream();
    ObjectOutputStream objectStream=new ObjectOutputStream(byteStream);
    objectStream.writeObject(data_to_send);
    messageBodyPart.setDataHandler(new DataHandler( new ByteArrayDataSource( byteStream.toByteArray(), "application/pdf" )));
         messageBodyPart.setFileName("attachment.pdf");
    multipart.addBodyPart(messageBodyPart);
    // Put parts in message
    message.setContent(multipart);
    // Send the message
    Transport.send( message );
    System.out.println("sent msg");
    Thanks
    Smi

    It's "corrupted" because you are sending a text string and not a PDF document.
    And that commented-out code that uses an ObjectOutputStream would have corrupted a PDF document anyway, if you had one.
    I suggest if this problem is urgent then you hire professional programming help to get it done. You are a long way from a solution.

  • How to send a single email to all recipients at one time

    Hi,
    With JavaMail, is there any way to send an email to several recipients at once time
    instead of calling Transport.send() one by one? You may state why not use
    address like "[email protected],[email protected],[email protected]".
    Because I want to have a single recipient address appeared on the "Address To"
    field on email instead of showing all recipients addresses on the "Address To" field.
    Thanks for your attention in advance,
    Raymond

    If you don't want all the recipients to see each other's addresses (and that's often what you do want), put that list into the BCC address and not the To address.

  • Mail Sender Adapter - Move email after picked up

    Hello,
    We are planning to connect SAP PI with the MS exchange server in order to get some email attachments and process them. We have find how we should configure the adapter to connect the exchange server  (( [Sender Mail configuration|http://help.sap.com/saphelp_nw04/Helpdata/EN/23/c093409c663228e10000000a1550b0/content.htm] )) but we still have a doubt related with the message already processed.
    In the adapter parameters there is one section regarding 'Delete message once read' + u2018Folder for deleted messageu2019 where the emails could be sent once processed. Is it possible to configure multiple folders based in the sender, receiver, subject of the email? What we would need is organize the processed emails based in simply rules.
    How could we perform this behavior with the standard adapter for email?
    Thanks & Regards,

    I do not think PI would let you do that. How ever, once you move your read mail in to one of the folders on your Exchange server, you can configure rule there (on that mail box.. may be) so that based on sender/mail subject etc the messages can be distributed in to further folders.
    VJ

  • Mail sending from WRONG EMAIL

    Hi. I'm using 2 gmail accounts and when I send an email from one, the user receives from my other account. It doesn't happen all the time, and has only been happening recently. It's strange because after the 1st time, I started checking that drop down box that asks which email I want to send from, and it is set correctly. This even occurs sometimes when I reply to an email, which by default will send emails from the address that the email was sent to. Also, I know something is wrong because 1 email address has a signature that states the email address it came from, while the other email address has no signature at all. When I get replies to the email I sent, it shows my signature, but is replied to my other email address. Has anyone else run into this issue? Are there any solutions? It's quite frustrating.

    The pulldown menu in the message composition window that selects account doesn't select the smtp server for that account, you have to go into Mail Prefs to ensure which smtp server is associated with which account.
    Go to Mail Prefs, Accounts and select each gmail account one at a time and check the following: In the Account Info panel, check that the outgoing mail server (smtp) is the one you think it should be.
    I'm assuming that gmail requires a username/password to send a message; the server for each account would be listed something like: smtp.gmail.com:username1 for the first account and smtp.gmail.com:username2 for the second gmail account.
    If they're not what they should be, open the outgoing mail server (smtp) pulldown menu and either select the correct server or choose "edit server list" and fix it. Also consider clicking the "use only this server" checkbox for both accounts.
    Hope this helps.

Maybe you are looking for

  • Can I recreate an iTunes library on a restored PC from my iPod?

    What happened to me went like this: I had my iTunes library which synced to my iPod perfectly. Then one day, my PC crashed and when I formatted it, I copied all my music from my iPod to my computer and reinstalled iTunes like a new software. What I w

  • FA error message

    Hi Expert, I got an error while posting an asset via F-02. "Auxiliary account assignment to asset is not possible, remove entry" I am posting to a fixed asset clearing account, then I entered the asset no. and ticked "asset reitrement". In the past,

  • Using JNDI Provider for Oracle JMS Queue

    Hello, I created a JMS Queue in Oracle 9.2.0.1 and would like a Java client to receive events from the Queue. I am not running Oracle9iAS. I have access to WebLogic server 7.0 which is also a JNDI provider. Is there a sample code that shows the steps

  • Error using JDBC and DB2 - Please help

    Hi, I need some help solving this problem. I ran the same program at my university and it worked. At home I am using TomCat4 and j2sdk1.4.1. I want to connect to the IBM DB2 Universal database personal edition v7. The program compiles, but when I run

  • Urgent !!!!!! - intermedia error

    Hi all If I try the following query select count(prt_id) from pr_prt where contains(prt_id,'1%')>0 i get the following error ERROR at line 1: ORA-29902: error in executing ODCIIndexStart() routine ORA-20000: interMedia Text error: DRG-50937: query to