v_mailto now works without attachments

This commit is contained in:
luis daniel lucio quiroz 2015-01-07 03:18:35 +00:00
parent 2132893a80
commit c66d89302a
1 changed files with 8 additions and 5 deletions

View File

@ -23,6 +23,7 @@
Contributor(s): Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com> Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/ */
//set the include path //set the include path
@ -83,6 +84,7 @@
} }
else { else {
//get the headers //get the headers
print_r($decoded[0]);
$headers = json_decode($decoded[0]["Headers"]["x-headers:"], true); $headers = json_decode($decoded[0]["Headers"]["x-headers:"], true);
$subject = $decoded[0]["Headers"]["subject:"]; $subject = $decoded[0]["Headers"]["subject:"];
$from = $decoded[0]["Headers"]["from:"]; $from = $decoded[0]["Headers"]["from:"];
@ -105,9 +107,10 @@
} }
else { else {
$content_type_array = explode(";", $content_type); $content_type_array = explode(";", $content_type);
if ($content_type_array[0] == "text/html" || $content_type_array[0] == "text/plain") { $body = $decoded[0]["Body"];
$body = $row["Body"]; //if ($content_type_array[0] == "text/html" || $content_type_array[0] == "text/plain") {
} // $body = $row["Body"];
//}
} }
} }
@ -175,7 +178,7 @@
echo "Reply-to: ".$reply_to."\n"; echo "Reply-to: ".$reply_to."\n";
echo "To: ".$to."\n"; echo "To: ".$to."\n";
echo "Date: ".$date."\n"; echo "Date: ".$date."\n";
//echo "Body: ".$body."\n"; echo "Body: ".$body."\n";
//add to, from, fromname, custom headers and subject to the email //add to, from, fromname, custom headers and subject to the email
$mail->From = $smtp['from'] ; $mail->From = $smtp['from'] ;