diff --git a/includes/email.php b/includes/email.php index e85bb6d..cc76a26 100644 --- a/includes/email.php +++ b/includes/email.php @@ -60,7 +60,8 @@ class Email { // Strip internal-only keys that are not CyberMail API fields $apiOptions = array_diff_key($options, array_flip(['metadata'])); $payload = array_merge([ - 'from' => $this->fromName . ' <' . $this->fromEmail . '>', + 'from' => $this->fromEmail, + 'from_name' => $this->fromName, 'to' => $to, 'subject' => $subject, 'html' => $html, diff --git a/includes/functions.php b/includes/functions.php index 86019c4..936c2a3 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -336,7 +336,7 @@ function sendEmail($to, $subject, $htmlContent, $textContent = '') { error_log('[TJJ sendEmail] CYBERMAIL_API_KEY not configured'); return false; } - $payload = ['from' => $fromName . ' <' . $from . '>', 'to' => $to, 'subject' => $subject, 'html' => $htmlContent]; + $payload = ['from' => $from, 'from_name' => $fromName, 'to' => $to, 'subject' => $subject, 'html' => $htmlContent]; if ($textContent) $payload['text'] = $textContent; $ch = curl_init('https://platform.cyberpersons.com/email/v1/send'); curl_setopt_array($ch, [