in reply to sending batch of emails by looping

Your recipients should be in @to which I would rename to @recipients and then:

for my $recipient(@recipients) { mail($recipient); } sub mail { my $recipient = shift; …; }

Add more args to your sub, like $from, $message, $transport etc.

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re^2: sending batch of emails by looping
by frank1 (Monk) on Jul 26, 2023 at 20:48 UTC

    Thank you so much, this has solved my problem, thanks so so so much