in reply to Re^7: Selecting DB
in thread Selecting DB
i have tried all options, which all monks given me. but am still facing some problem
this is the script, still cant send to all emails, it only sends to last email. but first ones are not being sent to
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 ]; for my $em ( @$TotalEmails ){} my $message_s = "<p>hi test</p>"; my $smtpserver = 'mail.xxxxxx.com'; my $smtpport = 587; my $smtpuser = 'xxxx.com'; my $smtppassword = 'xxxxxxxx'; 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 => join(", ", @$em), From => 'xxxx@xxx.com', Subject => "test em", 'Content-Type' => 'text/html', ], body => $message_s, ); sendmail($email_s, { transport => $transport });
but now the error is that. 'no recipients' after doing some changes myself
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Selecting DB
by hippo (Archbishop) on Jul 10, 2023 at 14:22 UTC | |
by tybalt89 (Monsignor) on Jul 10, 2023 at 22:56 UTC | |
by hippo (Archbishop) on Jul 11, 2023 at 08:27 UTC | |
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 |