Hello,
For some reason when I send HTML formatted emails via Qcodo's QEmailMessage and QEmailServer, I can't see any images. However, when I send manually via PHP mail function. It works just fine. Do I need to set any additional headers or anything before sending? Here's my code:
<?php
include('app/includes/prepend.inc.php');
// We want to define our email SMTP server (it defaults to "localhost")
// This would typically be done in prepend.inc, and its value should probably be a constant
// that is defined in _configuration.inc
//QEmailServer::$SmtpServer = 'mx.acme.com';
// Create a new message
// Note that you can list multiple addresses and that Qcodo supports Bcc and Cc
$objMessage = new QEmailMessage();
$objMessage->From = 'ACME Reporting Service <reporting@acme.com>';
$objMessage->To = 'Mr. Tester <myemail@gmail.com>';
//$objMessage->Bcc = 'audit-system@acme.com';
$objMessage->Subject = 'Report for ' . QDateTime::NowToString(QDateTime::FormatDisplayDate);
// Setup Plaintext Message
$strBody = "Dear John and Jane Doe,\r\n\r\n";
$strBody .= "You have new reports to review. Please go to the ACME Portal at http://portal.acme.com/ to review.\r\n\r\n";
$strBody .= "Regards,\r\nACME Reporting Service";
$objMessage->Body = $strBody;
// Also setup HTML message (optional)
$strBody = 'Dear John and Jane Doe,<br/><br/>';
$strBody .= '<img height=131 src="http://www.p1computerparts.com/images/email_order_banner.jpg" width=529 />';
$strBody .= '<b>You have new reports to review.</b> Please go to the <a href="http://portal.acme.com/">ACME Portal</a> to review.<br/><br/>';
$strBody .= 'Regards,<br/><b>ACME Reporting Service</b><br />';
$objMessage->HtmlBody = $strBody;
// Add random/custom email headers
$objMessage->SetHeader('x-application', 'ACME Reporting Service v1.2a');
// Send the Message (Commented out for obvious reasons)
QEmailServer::Send($objMessage);
// THIS WORKS
//$headers = 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//mail('myemail@gmail.com', 'Hello', $strBody, $headers);
// Note that you can also shortcut the Send command to one line for simple messages (similar to PHP's mail())
$strBody = "Dear John and Jane Doe,\r\n\r\n";
$strBody .= "You have new reports to review. Please go to the ACME Portal at http://portal.acme.com/ to review.\r\n\r\n";
$strBody .= "Regards,\r\nACME Reporting Service";
// QEmailServer::Send(new QEmailMessage('reporting@acme.com', 'jdoe@acme.com', 'Alerts Received!', $strBody));
?>
bc.