frank1 has asked for the wisdom of the Perl Monks concerning the following question:
My script is sending emails, but i have a privacy issue that each and every recipients sees all other recipients
How can i send emails to each recipient individually.
my $AID = "XD4555"; my $query = $dbh->prepare("SELECT snd.EMAIL FROM FUSERS as m JOIN USERS as snd ON snd.USERID = m.USERID WHERE (m.USERID_IM = ?)"); $query->execute($AID); my $user1 = $query->fetchall_arrayref(); my $query_other = $dbh->prepare("SELECT snd.EMAIL FROM FUSERS as m JOIN USERS as snd ON snd.USERID = m.USERID_IM WHERE (m.USERID = ?)"); $query_other->execute($AID); my $user2 = $query_other->fetchall_arrayref(); my $TotalEmails = [ @$user1, @$user2 ]; my @to; for my $em ( @$TotalEmails ) { push @to, @$em; } my $tostring = join ',', @to; my $message_s = "<p>hi just test</p>"; my $smtpserver = 'smtp.xxxxxx.com'; my $smtpport = 587; my $smtpuser = 'xxxxx'; my $smtppassword = 'xxxxx'; my $transport = Email::Sender::Transport::SMTP->new({ host => $smtpserver, ssl => 'starttls', port => $smtpport, sasl_username => $smtpuser, sasl_password => $smtppassword, }); my $email_s = Email::Simple->create( header => [ To => $tostring, From => 'xxx@xxxx.com', Subject => "test hi", 'Content-Type' => 'text/html', ], body => $message_s, ); sendmail($email_s, { transport => $transport });
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending email
by marto (Cardinal) on Jul 21, 2023 at 11:57 UTC | |
by frank1 (Monk) on Jul 21, 2023 at 12:34 UTC | |
by jdporter (Paladin) on Jul 21, 2023 at 13:09 UTC | |
by frank1 (Monk) on Jul 21, 2023 at 18:18 UTC | |
|
Re: Sending email
by pryrt (Abbot) on Jul 21, 2023 at 19:16 UTC | |
by frank1 (Monk) on Jul 22, 2023 at 12:29 UTC | |
by kcott (Archbishop) on Jul 22, 2023 at 15:42 UTC | |
by frank1 (Monk) on Jul 22, 2023 at 16:44 UTC | |
|
Re: Sending email
by afoken (Chancellor) on Jul 21, 2023 at 16:58 UTC |