0

I am using pear to send SMTP mail with HTML format, everything was fine, but in the last report you make, the report goes wrong formatted and the reason is because the HTML adds an exclamation mark (!) In random parts and when it falls by means of a label or style moves everything. If someone can give me a hand.

function sendEmail($parameters) {
require_once "Mail.php";
print_r($parameters['emailBody']);
$from = "XXXXXXXXXX";
$to = $parameters['emailAddress'];
$subject = $parameters['reportName'];

$host = "XXXXXX";
$port = "XXXX";

$headers = array('From' => $from,
    'To' => $to,
    'Subject' => $subject,
    'Content-type' => 'text/html; charset=utf8');
$smtp = Mail::factory('smtp', array('host' => $host,
            'port' => $port,
            'auth' => false));

$mail = $smtp->send($to, $headers, $parameters['emailBody']);

}

<td>!</td>
josemm1790
  • 831
  • 2
  • 11
  • 19
  • Can you also add how you're calling this? You say that the function works sometimes, but not on the last call? Where are you calling it from? What's different between the previous calls, and the final one? – andrewsi Aug 16 '13 at 16:13
  • is the same call, is a system of sending reports via email, all reports so far no problems, but that if. – josemm1790 Aug 16 '13 at 16:18
  • Can you add the code (the loop?) that calls this, then? – andrewsi Aug 16 '13 at 16:20
  • At this point remove the reporting loop to treat individually to try and continue with the same problem. The same HTML that generates the reporting system for a browser I visualize and and generates a report that correctly. – josemm1790 Aug 16 '13 at 16:25

1 Answers1

0

Well after searching a bit, I found that HTML was not formatted, missing lines changes and apparently when this all in one line, is poorly formatted and interpreted otherwise.

Thanks for your time.

josemm1790
  • 831
  • 2
  • 11
  • 19