'smtp.zpush.org', 'port' => 25, 'auth' => true, "username" => "fmbiete", "password" => "password_account", "debug" => true, "pipelining" => true); $toaddr = "fmbiete@zpush.org"; $headers = array('Subject' => 'Testing SMTP', 'From' => 'fmbiete@zpush.org', 'Return-Path' => 'fmbiete@zpush.org', 'To' => 'fmbiete@zpush.org', 'Cc' => 'fmbiete@zpush.org,fmbiete@zpush.net', 'Bcc' => array('fmbiete2@zpush.org', 'fmbiete2@zpush.net', 'fmbiete@zpush.org')); $body = "This is a test"; if (is_array($toaddr)) { $recipients = $toaddr; } else { $recipients = array($toaddr); } // Cc and Bcc headers are sent, but we need to make sure that the recipient list contains them foreach (array("CC", "cc", "Cc", "BCC", "Bcc", "bcc") as $key) { if (!empty($headers[$key])) { if (is_array($headers[$key])) { $recipients = array_merge($recipients, $headers[$key]); } else { $recipients[] = $headers[$key]; } } } ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->sendMessage(): SendingMail with %s", "smtp")); $mail =& Mail::factory("smtp", $imap_smtp_params); $send = $mail->send($recipients, $headers, $body); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->sendMessage(): send return value %s", $send)); if ($send !== true) { ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->SendMail(): The email could not be sent")); }