From 4f5b832157bf01cda00a71608cc2a53309738093 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Mon, 18 Apr 2022 12:13:43 -0600 Subject: [PATCH] Use the email class object. --- secure/fax_to_email.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/secure/fax_to_email.php b/secure/fax_to_email.php index 281d81cca0..fb961c4268 100644 --- a/secure/fax_to_email.php +++ b/secure/fax_to_email.php @@ -619,7 +619,15 @@ if (!function_exists('fax_split_dtmf')) { } //$email_response = send_email($email_address, $email_subject, $email_body); - $email_response = !send_email($fax_email, $email_subject, $email_body, $email_error, $email_from_address, $email_from_name, 3, 3, $email_attachments) ? false : true; + $email = new email; + $email->recipients = $fax_email; + $email->subject = $email_subject; + $email->body = $email_body; + $email->from_address = $email_from_address; + $email->from_name = $email_from_name; + $email->attachments = $email_attachments; + $response = $mail->error; + $sent = $email->send(); } //output to the log @@ -628,13 +636,13 @@ if (!function_exists('fax_split_dtmf')) { echo "email_subject: $email_subject\n"; //send the email - if ($email_response) { + if ($sent) { echo "Mailer Error"; - $email_status=$mail; + $email_status='failed'; } else { echo "Message sent!"; - $email_status="ok"; + $email_status='ok'; } }