http://www.perlmonks.org?node_id=859648

kamal has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to be able to send email to multiple email addresses in
my $email = Email::Simple->create( header => [ To => '"My Name" <myname@something +.com>', From => '"Someone1" <some@somewhere. +com>', Subject => $subject, ], body => $body ); sendmail( $email, { transport => $transport } );
is it possible to write: From => '"Someone1" <some@somewhere.com>', '"Someone2" <some2@somewhere.com>' Thanks, -Kamal.
  • Comment on How can i send email to Multiple email addresses using Email::Simple
  • Download Code

Replies are listed 'Best First'.
Re: How can i send email to Multiple email addresses using Email::Simple
by merlyn (Sage) on Sep 10, 2010 at 16:50 UTC
    I suspect this will work:
    To => 'first@example.com, second@example.com, third@example.com'
    Please don't use names like "something.com" and "somewhere.com" in examples unless you own them. They are likely owned by people who are now a bit more angry at you. There are reserved names like "example.com" reserved for examples.

    -- Randal L. Schwartz, Perl hacker

    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Re: How can i send email to Multiple email addresses using Email::Simple
by JavaFan (Canon) on Sep 10, 2010 at 15:04 UTC
    1. From says who send the mail. So, adding addresses to the From header doesn't get your mail delivered multiple times.
    2. Why ask if something is possible? Why don't you try and see?
    3. Did you read the documentation of Email::Simple?
    4. You probably need the 'Cc' header. Read the manual page how to set it.
Re: How can i send email to Multiple email addresses using Email::Simple
by tune (Curate) on Sep 11, 2010 at 11:03 UTC