in reply to Re^8: Selecting DB
in thread Selecting DB
You have set the addresses you will be sending to like this:
To => join(", ", @$em),
but nowhere have you set $em to anything, so the array is empty, so you have no recipients. A quick SSCCE to show how to pull these AoAs together:
#!/usr/bin/env perl use strict; use warnings; my $user1 = [ [ 'alpha@foo.com', 'beta@foo.dom' ], [ 'gamma@foo.com' ] + ]; my $user2 = [ [ 'delta@foo.com' ], [ 'epsilon@foo.dom', 'zeta@foo.com' + ] ]; my $TotalEmails = [ @$user1, @$user2 ]; my @to; for my $em ( @$TotalEmails ) { push @to, @$em; } my $tostring = join ',', @to; print "Full list of addrs: $tostring\n";
See how that works? You don't even really need the intermediate $TotalEmails but I've left it in for clarity. You can now use $tostring when sending your emails and they should all go out.
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: Selecting DB
by tybalt89 (Monsignor) on Jul 10, 2023 at 22:56 UTC | |
by hippo (Archbishop) on Jul 11, 2023 at 08:27 UTC | |
|
Re^10: Selecting DB
by frank1 (Monk) on Jul 10, 2023 at 15:41 UTC | |
by afoken (Chancellor) on Jul 11, 2023 at 17:03 UTC | |
by frank1 (Monk) on Jul 21, 2023 at 11:43 UTC |