/**
* Build the body of the message in the appropriate format.
* @private
* @returns void
*/
public function buildBody()
{
$this->CheckChanges();
// Determine line endings for message
if ($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0) {
$eol = "<br/>";
$bullet = "<li>";
$bullet_start = "<ul>";
$bullet_end = "</ul>";
} else {
$eol = "\n";
$bullet = " - ";
$bullet_start = "";
$bullet_end = "";
}
$ReportBody = "";
$ReportBody .= "---------------------" . $eol;
$ReportBody .= "Unit Test Information" . $eol;
$ReportBody .= "---------------------" . $eol;
$ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;
$ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
if (strlen($this->Mail->Host) > 0) {
$ReportBody .= "Host: " . $this->Mail->Host . $eol;
}
// If attachments then create an attachment list
$attachments = $this->Mail->getAttachments();
if (count($attachments) > 0) {
$ReportBody .= "Attachments:" . $eol;
$ReportBody .= $bullet_start;
foreach ($attachments as $attachment) {
$ReportBody .= $bullet . "Name: " . $attachment[1] . ", ";
$ReportBody .= "Encoding: " . $attachment[3] . ", ";
$ReportBody .= "Type: " . $attachment[4] . $eol;
}
$ReportBody .= $bullet_end . $eol;
}
// If there are changes then list them
if (count($this->ChangeLog) > 0) {
$ReportBody .= "Changes" . $eol;
$ReportBody .= "-------" . $eol;
$ReportBody .= $bullet_start;
for ($i = 0; $i < count($this->ChangeLog); $i++) {
$ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" . $this->ChangeLog[$i][1] . "]" . $eol;
}
$ReportBody .= $bullet_end . $eol . $eol;
}
// If there are notes then list them
if (count($this->NoteLog) > 0) {
$ReportBody .= "Notes" . $eol;
$ReportBody .= "-----" . $eol;
$ReportBody .= $bullet_start;
for ($i = 0; $i < count($this->NoteLog); $i++) {
$ReportBody .= $bullet . $this->NoteLog[$i] . $eol;
}
$ReportBody .= $bullet_end;
}
// Re-attach the original body
$this->Mail->Body .= $eol . $eol . $ReportBody;
}