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

As for sending more than one contact example: $ smtp-> to ("some1@gmail.com", "som2@gmail.com");
my $domain = Net::SMTP->new('smtp.gmail.com', Timeout => 30); my $domainhost = $domain->domain; if (not $smtp = Net::SMTP::TLS->new('smtp.gmail.com', Hello => $domainhost, Port => 587, User => $from, Password => $password, Timeout => 30, Debug => 1)) {die "not connected\n";} $smtp->to("some1@gmail.com\n", "some2@gmail.com\n"); $smtp->data(); $smtp->datasend("From: " . "some_from" . "\n"); $smtp->datasend("\n"); $smtp->datasend('Subject: some_subject'); $smtp->datasend("\n"); $smtp->datasend("test"); $smtp->dataend(); $smtp->quit;

Replies are listed 'Best First'.
Re: As for sending more than one contact using perl TLS gmail
by jethro (Monsignor) on Jan 28, 2011 at 01:21 UTC

    Is this an answer that should have been in some previous thread or did you just forget to ask a question?

    If your question is "why is this script not working", without having tested it I would guess that

    $smtp->to("some1@gmail.com\n", "some2@gmail.com\n");

    should work better if written like this:

    $smtp->to("some1\@gmail.com", "some2\@gmail.com");
      So I put as an example, I do not know how to get a message to more than one contact gmail.
      $smtp->to("some1@gmail.com\n", "some2@gmail.com\n");
      jethro, even with the changes do not run.
      $smtp->to("some1\@gmail.com\n", "some2\@gmail.com\n");
      return erro:
      Couldn't send TO <some1@gmail.com >: 503 5.5.1 MAIL first. v39sm373565yba.19 at gmail_test.pl line 235

        Remove the \n from your email adresses:

        $smtp->to("some1\@gmail.com", "some2\@gmail.com");