This commit is contained in:
markjcrane
2016-05-04 22:47:13 -06:00
3 changed files with 1707 additions and 1695 deletions
+15 -4
View File
@@ -80,6 +80,10 @@
require('resources/pop3/mime_parser.php'); require('resources/pop3/mime_parser.php');
require('resources/pop3/rfc822_addresses.php'); require('resources/pop3/rfc822_addresses.php');
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/emails/email_translation.php")) {
require_once($_SERVER["PROJECT_ROOT"]."/app/emails/email_translation.php");
}
//parse the email message //parse the email message
$mime=new mime_parser_class; $mime=new mime_parser_class;
$mime->decode_bodies = 1; $mime->decode_bodies = 1;
@@ -282,6 +286,13 @@
//add an attachment //add an attachment
$mail->AddStringAttachment($parts_array["Body"],$file,$encoding,$mime_type); $mail->AddStringAttachment($parts_array["Body"],$file,$encoding,$mime_type);
if (function_exists(get_transcription)) {
$attachments_array=$mail->GetAttachments();
$transcription=get_transcription($attachments_array[0]);
echo "Transcription: " . $transcription;
} else {
$transcription = '';
}
} }
} }
} }
@@ -291,13 +302,13 @@
//echo "body_plain = $body_plain\n"; //echo "body_plain = $body_plain\n";
if ((substr($body, 0, 5) == "<html") || (substr($body, 0, 9) == "<!doctype")) { if ((substr($body, 0, 5) == "<html") || (substr($body, 0, 9) == "<!doctype")) {
$mail->ContentType = "text/html"; $mail->ContentType = "text/html";
$mail->Body = $body; $mail->Body = $body."<br><br>".nl2br($transcription);
$mail->AltBody = $body_plain; $mail->AltBody = $body_plain."\n\n$transcription";
} }
else { else {
// $mail->Body = ($body != '') ? $body : $body_plain; // $mail->Body = ($body != '') ? $body : $body_plain;
$mail->Body = $body_plain; $mail->Body = $body_plain."\n\n$transcription";
$mail->AltBody = $body_plain; $mail->AltBody = $body_plain."\n\n$transcription";
} }
//send the email //send the email
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff