Example #1
0
         add_unknown_reciepent($bcc_address, $add_reciever_ab);
     }
 }
 if ($html_message) {
     $mail->Body = $html_mail_head . $mail_body . $html_mail_foot;
     $htmlToText = new Html2Text($mail_body);
     $mail->AltBody = $htmlToText->get_text();
 } else {
     $mail->Body = $mail_body;
 }
 if (!$mail->Send()) {
     $feedback = '<p class="Error">' . $ml_send_error . ' ' . $mail->ErrorInfo . '</p>';
 } else {
     //set Line enidng to \r\n for Cyrus IMAP
     $mail->LE = "\r\n";
     $mime = $mail->GetMime();
     if (isset($_SESSION['attach_array'])) {
         while ($attachment = array_shift($_SESSION['attach_array'])) {
             @unlink($attachment->tmp_file);
         }
     }
     // We need to unregister the attachments array and num_attach
     unset($_SESSION['num_attach']);
     unset($_SESSION['attach_array']);
     if ($profile["type"] == "imap") {
         $sent_folder = $profile['sent'];
         if ($sent_folder != '') {
             require $GO_CONFIG->class_path . "imap.class.inc";
             $imap_stream = new imap();
             if ($imap_stream->open($profile["host"], "imap", $profile["port"], $profile["username"], $GO_CRYPTO->decrypt($profile["password"]), $sent_folder)) {
                 if ($imap_stream->append_message($sent_folder, $mime, "\\Seen")) {