in reply to Re^2: Sending email
in thread Sending email

You don't show it here, but in your OP you have:

my $tostring = join ',', @to;

There's not enough of your code in one place, but I'd suggest changing

to => [$tostring]

to something closer to

to => [@to]

The '[...]' construct creates an anonymous array reference. Between '[' and ']', you can put a single scalar or a list of scalars:

[$scalar1] # OK [$scalar1, $scalar2] # OK ["$scalar1, $scalar2"] # NOT OK ['$scalar1, $scalar2'] # NOT OK

— Ken

Replies are listed 'Best First'.
Re^4: Sending email
by frank1 (Monk) on Jul 22, 2023 at 16:44 UTC

    i have tried most ways but i think its a module problem

    because this way, Bcc method is working. this method is working for me, but i wanted good module which supports smtp and html message

    my $to = ''; my $from = 'xxx@xxx.com'; my $subject = $subject; my $message = " $msg "; open(MAIL, "|/usr/sbin/sendmail -t"); print MAIL "To: $to\n"; print MAIL "Bcc: $emails\n"; print MAIL "From: $from\n"; print MAIL "Subject: $subject\n\n"; print MAIL $message; close(MAIL);