function sendEmail($email, $subject, $body) { require_once 'class/class.phpmailer2.php'; $connect = new db(); $mail = new PHPMailer(); $mail->IsAmazonSES(); $mail->AddAmazonSESKey($connect->aws_access_key_id, $connect->aws_secret_key); // Enable SMTP authentication $mail->CharSet = "UTF-8"; // SMTP secret $mail->From = '*****@*****.**'; $mail->FromName = 'Tabluu Support'; $mail->Subject = $subject; $mail->AltBody = $body; $mail->Body = $body; $mail->AddAddress($email); $mail->addBCC("*****@*****.**"); //if($rows->permission > 0) //$mail->addBCC($rows->usermail); //$mail->AddAddress('*****@*****.**'); $mail->Send(); $mail->ClearAllRecipients(); return; }
$plain_text = $name . ', ' . _('Your password has been reset, here\'s your new one') . ': ' . _('Password') . ': ' . $new_pass . ' ' . _('Remember to change it immediately once you log back in.'); $message = ' <p>' . $name . ',</p> <p>' . _('Your password has been reset, here\'s your new one') . ':</p> <p><strong>' . _('Password') . '</strong>: ' . $new_pass . '</p> <p>' . _('Remember to change it immediately once you log back in.') . '</p> '; //send email to me $mail = new PHPMailer(); if ($aws_key != '' && $aws_secret != '') { $mail->IsAmazonSES(); $mail->AddAmazonSESKey($aws_key, $aws_secret); } $mail->CharSet = "UTF-8"; $mail->From = $email; $mail->FromName = $company; $mail->Subject = '[' . $company . '] ' . _('Your new password'); $mail->AltBody = $plain_text; $mail->MsgHTML($message); $mail->AddAddress($email, $company); $mail->Send(); } echo true; } else { echo _('Email does not exist.'); }
} else { $error_recipients_ids_array = explode(',', $error_recipients_ids); $eid_array = array(); foreach ($error_recipients_ids_array as $id_val) { $id_val_array = explode(':', $id_val); array_push($eid_array, $id_val_array[0]); } $error_recipients_ids = implode(',', $eid_array); $q10 = 'UPDATE subscribers SET bounce_soft = 0 WHERE list IN (' . $tsl . ') AND id NOT IN (' . $error_recipients_ids . ')'; mysqli_query($mysqli, $q10); } } //send email to sender $mail2 = new PHPMailer(); if ($s3_key != '' && $s3_secret != '') { $mail2->IsAmazonSES(); $mail2->AddAmazonSESKey($s3_key, $s3_secret); } else { if ($smtp_host != '' && $smtp_port != '' && $smtp_ssl != '' && $smtp_username != '' && $smtp_password != '') { $mail2->IsSMTP(); $mail2->SMTPDebug = 0; $mail2->SMTPAuth = true; $mail2->SMTPSecure = $smtp_ssl; $mail2->Host = $smtp_host; $mail2->Port = $smtp_port; $mail2->Username = $smtp_username; $mail2->Password = $smtp_password; } } $mail2->Timezone = $user_timezone; $mail2->CharSet = "UTF-8";
$currentdaynumber = strftime('%d', $today); $currentday = strftime('%A', $today); $currentmonthnumber = strftime('%m', $today); $currentmonth = strftime('%B', $today); $currentyear = strftime('%Y', $today); $unconverted_date = array('[currentdaynumber]', '[currentday]', '[currentmonthnumber]', '[currentmonth]', '[currentyear]'); $converted_date = array($currentdaynumber, $currentday, $currentmonthnumber, $currentmonth, $currentyear); $html_treated = str_replace($unconverted_date, $converted_date, $html_treated); $plain_treated = str_replace($unconverted_date, $converted_date, $plain_treated); $title_treated = str_replace($unconverted_date, $converted_date, $title_treated); //add tracking 1 by 1px image $html_treated .= '<img src="' . APP_PATH . '/t/' . short($ares_id) . '/' . short($subscriber_id) . '/a" alt=""/>'; //send email $mail = new PHPMailer(); if ($s3_key != '' && $s3_secret != '') { $mail->IsAmazonSES(false, $ares_id, $subscriber_id, '', 0, true); $mail->AddAmazonSESKey($s3_key, $s3_secret); } else { if ($smtp_host != '' && $smtp_port != '' && $smtp_ssl != '' && $smtp_username != '' && $smtp_password != '') { $mail->IsSMTP(); $mail->SMTPDebug = 0; $mail->SMTPAuth = true; $mail->SMTPSecure = $smtp_ssl; $mail->Host = $smtp_host; $mail->Port = $smtp_port; $mail->Username = $smtp_username; $mail->Password = $smtp_password; } } $mail->Timezone = $user_timezone; $mail->CharSet = "UTF-8";