defined('MAIL_FROM') ? MAIL_FROM : 'noreply@epictravelexpeditions.com', 'to' => $toEmail, 'subject' => $subject, 'html' => $htmlBody, ]; if ($textBody) $payload['text'] = $textBody; $ch = curl_init('https://platform.cyberpersons.com/email/v1/send'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $apiKey, 'Content-Type: application/json', ], CURLOPT_TIMEOUT => 20, CURLOPT_SSL_VERIFYPEER => false, ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode === 202) return true; error_log('[EpicTravel mailer] CyberMail HTTP ' . $httpCode . ' — ' . $response); return false; } function sendContactAlert(string $name, string $email, string $message): bool { $adminEmail = defined('ADMIN_EMAIL') ? ADMIN_EMAIL : 'admin@epictravelexpeditions.com'; $subject = "New Contact Form Submission from {$name}"; $html = '
New Contact Form Message
| Name | ' . htmlspecialchars($name) . ' |
| ' . htmlspecialchars($email) . ' |
' . nl2br(htmlspecialchars($message)) . '
Submitted ' . date('F j, Y \a\t g:i A T') . '
© ' . date('Y') . ' Epic Travel Expeditions
We received your message and our team will get back to you within 1–2 business days.
In the meantime, feel free to browse our destinations and current travel specials:
Adventure awaits,
The Epic Travel Team
© ' . date('Y') . ' Epic Travel Expeditions