How to emai more than one person

hi, can someone please post some code on how to send more than one person the same email, i tried what's below but get an error:
//  Send message out as email via JavaMail
//  Emails for group 1
String namesOne[] = {"[email protected], [email protected]"};
//  Vector to store names
Vector namesInGroup = new Vector();
//  Add names to vector
for(int i=0; i<namesOne.length; i++) {
     namesInGroup.add(namesOne);
Properties props = new Properties();
props.put("mail.smtp.host", "???");
Session s = Session.getInstance(props);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new InternetAddress("[email protected]");
message.setFrom(from);
InternetAddress[] to = new InternetAddress[namesInGroup.size()];
String emailOfPerson;
for(int i=0; i<namesInGroup.size(); i++) {
     emailOfPerson = (String)namesInGroup.elementAt(i);
     to[i] = new InternetAddress(emailOfPerson);
message.setRecipients(Message.RecipientType.CC, to);
message.setSubject(subjectOfMessage);
String text = mailText.toString();
MimeMultipart mm = new MimeMultipart();
MimeBodyPart mbp = new MimeBodyPart();
mbp.setContent(text,"text/html");
mm.addBodyPart(mbp);
message.setContent(mm);
Transport.send(message);
// End of JavaMail code
the host is fine, ???, just didn't want to write it there, i've been able to email one person but can't get this to work, i get the following error:
[05/Sep/2002:15:27:03] failure (10730): Internal error: exception thrown from the servlet service function (uri=/WriteAndEmail.jsp): javax.servlet.ServletException: Illegal address, stack: javax.servlet.ServletException: Illegal address
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:384)
at WriteAndEmailjsp._jspService(_WriteAndEmail_jsp.java:291)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:826)
at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:533)
, root cause: javax.mail.internet.AddressException: Illegal address in string ``[email protected], [email protected]''
at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:66)
at WriteAndEmailjsp._jspService(_WriteAndEmail_jsp.java:243)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:826)
at com.netscape.server.http.servlet.NSServletRunner.Service(NSServletRunner.java:533)
both emails are valid.
Thank you.

soni29 wrote:
hi, can someone please post some code on how to send
more than one person the same email, i tried what's
below but get an error:
//  Send message out as email via JavaMail
//  Emails for group 1
String namesOne[] = {"[email protected],
[email protected]"};
//  Vector to store names
Vector namesInGroup = new Vector();
//  Add names to vector
for(int i=0; i<namesOne.length; i++) {
     namesInGroup.addElement(namesOne);
Properties props = new Properties();
props.put("mail.smtp.host", "???");
Session s = Session.getInstance(props);
MimeMessage message = new MimeMessage(s);
InternetAddress from = new
InternetAddress("[email protected]");
message.setFrom(from);
InternetAddress[] to = new
InternetAddress[namesInGroup.size()];
String emailOfPerson;
for(int i=0; i<namesInGroup.size(); i++) {
     emailOfPerson = (String)namesInGroup.elementAt(i);
     to[i] = new InternetAddress(emailOfPerson);
message.setRecipients(Message.RecipientType.CC, to);
message.setSubject(subjectOfMessage);
String text = mailText.toString();
MimeMultipart mm = new MimeMultipart();
MimeBodyPart mbp = new MimeBodyPart();
mbp.setContent(text,"text/html");
mm.addBodyPart(mbp);
message.setContent(mm);
Transport.send(message);
// End of JavaMail code
the host is fine, ???, just didn't want to write it
there, i've been able to email one person but can't
get this to work, i get the following error:
[05/Sep/2002:15:27:03] failure (10730): Internal
error: exception thrown from the servlet service
function (uri=/WriteAndEmail.jsp):
javax.servlet.ServletException: Illegal address,
stack: javax.servlet.ServletException: Illegal
address
at
org.apache.jasper.runtime.PageContextImpl.handlePageExc
ption(PageContextImpl.java:384)
at
WriteAndEmailjsp._jspService(_WriteAndEmail_jsp.java:
91)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBa
e.java:126)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java
826)
at
com.netscape.server.http.servlet.NSServletRunner.Servic
(NSServletRunner.java:533)
, root cause: javax.mail.internet.AddressException:
Illegal address in string ``[email protected],
[email protected]''
at
javax.mail.internet.InternetAddress.<init>(InternetAddr
ss.java:66)
at
WriteAndEmailjsp._jspService(_WriteAndEmail_jsp.java:
43)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBa
e.java:126)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java
826)
at
com.netscape.server.http.servlet.NSServletRunner.Servic
(NSServletRunner.java:533)
both emails are valid.
Thank you.
try using addElement()method of the vector.
or get all the address as one string represented by _to
where _to = "[email protected], [email protected]";
     //set to addresss
InternetAddress to = new InternetAddress() ;
InternetAddress [] toadd = to.parse(_to);
msg.setRecipients(Message.RecipientType.CC,toadd);
i hope this wouldhelp you
thanks and regards,
Suraj Berwal                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • How to make more than one person can access the database at one time

    how to make  more than one person can access the database at one time 

    Please post further f'up's in the Access forum.
    In short: for different reasons it is best practice that each user gets its own local copy of the database. This means that you need to split it into a front-end which only consists of the forms, queries, reports etc. Everything which doesn't need to be
    shared. And a back-end, which only stores the data.
    Take also a look at Allen Browne's article:
    Split your Access database into data and application.
    When you've splitted your database, you may often consider to use SQL Server as back-end. Here you may read Armen Stein's
    The Best of Both Worlds: Access-SQL Server Optimization.

  • How to Notify more than one person in case of error in ALE

    In ALE/EDI, While maintaining Partner Profile(we20), if in case we want to notify more than one person in case of error, how to maintain it in the <b>Post Processing: Permitted Agent tab</b>? Can anyone guide me navigating through the steps on how to proceed with this?

    enter in to the T-code.
    first it asks for validation from date click it.U will get th einitial screen.
    1.Enter the organisation name & description found at the basic data tab and press enter u can see that name will be diaplayed at the top grid.
    2.In the tool bar of the grid u can see drop down box in that select staff assignment.
    3.Now select createposition icon.
    4.Now place the cursor in user field right click & select assign->user in that enter ur user.
    Repeat the process to number of users.
    Save it.

  • How to pixalet more than one person on the same piece of footage?

    Trying to pixalet more than one person in a piece of video footage with Final Cut Pro X. Having problems trying to do more than one person.

    rebelrider1 wrote:
    Trying to pixalet more than one person…
    you can apply the Censor Effect, as most other effects, more than once:

  • Forwarding messages to more than one person at a time, how in the heck do i do it ??

    I recently got a new phone, and am trying to learn how to send messages to more than one person at a time. It is a Samsung Gem. 
    Thanks so much people,
    Gayle

    Gayle1963 wrote:
    I recently got a new phone, and am trying to learn how to send messages to more than one person at a time. It is a Samsung Gem. 
    Thanks so much people,
    Gayle
    Hi there!
    I hope you are enjoying your new phone.
    In order to forward a text message to multiple people, just long-press on the message you want to send and select 'Forward'. In the 'To:' field begin typing the first persons name, then hit the 'enter' key. This will typically move the cursor down to the message, just tap on the 'To:' field again and begin typing the second person's name, and so on and so forth until you get all the people included.
    Keep in mind, if you have a limited texting package that sent messages are billed per recipient. Example, if you forward a text to 10 people, then 10 messages go against the allowance.
    Have a great day!

  • How do people register for more than one person on a form?

    We had a lot of complaints last year from organizations who sent several employees to our training.  It took a long time for them to process these one at a time.  How do people register for more than one person on a form?

    Hi thearcca,
    This entirely depends on the form you create, you can add multiple choice button and ask for the no. of employees the organization wants to register.
    Also, you can add corresponding text field for the names.
    Thanks,
    Vikrantt Singh

  • How to save more than one Contact Person in CRM

    Hi experts,
                     How to save more than one contact persons in CRM opportunity Application?
    I am using following Function Module...
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
          it_partner        = lt_partner_com
        CHANGING
          ct_input_fields   = lt_input_fields
        EXCEPTIONS
          error_occurred    = 1
          document_locked   = 2
          no_change_allowed = 3
          no_authority      = 4
          OTHERS            = 5.
    I am giving the input field name as 'PARTNER_FCT', 'PARTNER_NO', 'DISPLAY_TYPE', 'NO_TYPE', 'MAIN_PARTNER' and 'RELATION_PARTNER'.
    The problem is it is saving only one contact person, not more than one.
    Please help me how to save more than one contact persons.

    In SPRO partner processing this needs to be configured.

  • How many sign-on's are included when I purchase Photoshop and Illustrator? Can more than one person have access on separate computers?

    How many sign-on's are included when I purchase Photoshop and Illustrator? Can more than one person have access on separate computers?

    You have 2 activations and the licenses is tied to you personally and you only. You cannot let other people use your software (unless they are family).
    Mylenium

  • How do I broadcast a wedding to more than one person?

    How can I broadcast a wedding to more than one person at a time?

    I missed your 2nd question.
    This article explains how to always show remote content and the risks of doing so. You can make that call. Adding your trusted senders to your address book will allow content from them and is the recommended action.
    http://kb.mozillazine.org/Privacy_basics_(Thunderbird)

  • When texting with more than one person at a time the incoming text scrolls to top of the conversation. anyone out there with the same issue?

    while texting with more than one person at a time the incoming texts scrolls to top of conversation. anyone having this issue?

    I've heard claims it can be done, claims some have done it, and claims that it didn't work for them. This thread is interesting, some indications it should be possible, complaints that it didn't, and also an interesting work-around:
    "How do I text message multiple people at once?"
    http://discussions.apple.com/click.jspa?searchID=-1&messageID=4822260
    You can ask Apple for iPhone changes via this link:
    http://www.apple.com/feedback/iphone.html
    Though if you're requesting hardware changes for iPhone v2 you may want to wait a week (or a month?)...they're probably going to be inundated right now by requests for software changes to the current iPhone.
    (If this has answered your question, please mark your original post as answered)

  • Outlook (ex Hotmail) on iPhone refuses to send e-mail to more than one person

    Hi,
    I have two questions today...
    When I try to send an e-mail to more than one person from my @outlook.com address on my iPhone it fails everytime and a message pops up that it could not connect to the server. Sending e-mails to one person at a time works perfectly. I think this is a Microsoft issue as I had to verify that I was "human" before I could send a test e-mail to more than one person while logged into the Outlook website on my PC. I never had problems like this on my old Gmail and Ymail accounts. Any ideas how to fix this?
    Alternatively, I can use my @icloud.com e-mail address, but this leads to my second question. Apple states that I cannot use my iCloud e-mail address as my Apple ID. I do however not want to keep two mailboxes. Can any e-mails Apple send me (eg. receipts for purchases, etc) be sent to my iCloud address? I'll can then just keep the other e-mail address just for the Apple ID but do not have to monitor it. It this can be done please advise where I can change this.
    Any advice will be greatly appreciated.

    Some style rules that Firefox handles well on the screen can cause this problem. Many email sites have a print button which simplifies the message format and removes navigation elements, etc., and Firefox generally handles print-formatted pages better. If your email site doesn't have print-formatted pages or those do not print, a "hack" is to select the text you want to print and then choose the Selection option in the print dialog.
    To hide email addresses from recipients, you need to place them in the BCC field. What do you put in the TO field in that case? You can use your own address.

  • I cant text chat with more than one person

    I can normally text chat just fine, but when i try to invite more than one person to chat, i get the following error message
    Couldn’t request chatroom “[screenname here] 619401”. (Your message is too long to be sent. Please shorten it.)
    (obviously where it says screenname here, thats my screen. all lowercase letters, no spaces or weird characters.
    the weird thing is if someone else invites me to a multi person text chat, it works just fine. i just cant initiate it. any suggestions???

    Here is how I initiate a text chat.
    (0) Click on one of my buddy names in my Buddy List to highlight it.
    (1) ⌘ click on the next buddy I want to add to highlight him, too.
    (2) Repeat the ⌘ clicks for all the other buddies I want in the chat.
    (3) Click the "A" at the bottom of my buddy list to initiate the multiple-party chat.
    Try that, and see if it works for you. If you can make it work for two, it should work for more.

  • Applescript: Sending a mail to more than one person

    I have a script tp send a message that the server has started in the morning to people.
    How can I get it to send it to more than one person?
    I use
    *set mailto_addr to [email protected]*
    how do I ad people to it?
    Thanks

    I saw that but do not know how to incorporate it.
    Either use a repeat loop:
      set recipient_list to {{name:"a", address:"[email protected]"}, {name:"b", address:"[email protected]"}, {name:"c", address:"[email protected]"}}
      set newMessage to (make new outgoing message with properties {subject:"The Subject", content:"your message here", visible:true})
      tell newMessage
        repeat with eachRecipient in recipient_list
          make new recipient at end of to recipients with properties {name:eachRecipient's name, address:eachRecipient's address}
        end repeat
      end tell
    Or add them individually:
      set newMessage to (make new outgoing message with properties {subject:"The Subject", content:"your message here", visible:true})
      tell newMessage
        make new recipient at end of to recipients with properties {name:"a", address:"[email protected]"}
        make new recipient at end of to recipients with properties {name:"b", address:"[email protected]"}
        make new recipient at end of to recipients with properties {name:"c", address:"[email protected]"}
      end tell

  • Sending a Text Message to More Than One Person...

    How do i send a single text message to more than one person? Is that possible?

    Not possible at present. It's on the list of feature requests. We hope an update will add this feature in the near future.

  • Sending text msgs to more than one person

    OK, I realize I'm probably just a doofus who can't figure this out, but how do you send a text message to more than one person on the iphone? I swear I've looked everywhere. Help, please? Thanks!

    You will need to use the email feature of the iPhone to do this.
    To send Apple feedback: http://apple.com/feedback

Maybe you are looking for