allthingsidLeroy:
During checkout, we're trying to send an html email to an email address. It works, but just not html. I've tested sending a newsletter and I can receive html emails fine from my zen cart install. All my email options settings are set to enable html. The email transport method is PHP.
Here's the code I'm using. If you guys could point me in the right direction it would be much appreciated.
$subject = "Test Subject";
$body = "<p>The body of the email.</p>";
zen_mail("", $email, $subject, $body, STORE_NAME, STORE_ADMIN_EMAIL, array("EMAIL_MESSAGE_HTML" => $body));
zen_mail can send html messages... Take a look at includes/functions/functions_email.php specifically at the zen_mail function and will see the following "guidance":
/**
- Send email. This is the central mail function.
- If using "PHP" transport method, the SMTP Server or other mail application should be configured correctly in server's php.ini
- @param string $to_name The name of the recipient, e.g. "Jim Johanssen"
- @param string $to_email_address The email address of the recipient, e.g. [email protected]
- @param string $email_subject The subject of the email
- @param string $email_text The text of the email, may contain HTML entities
- @param string $from_email_name The name of the sender, e.g. Shop Administration
- @param string $from_email_address The email address of the sender, e.g. [email protected]
- @param array $block Array containing values to be inserted into HTML-based email template
- @param string $module The module name of the routine calling zen_mail. Used for HTML template selection and email archiving.
- This is passed to the archive function denoting what module initiated the sending of the email
- @param array $attachments_list Array of attachment names/mime-types to be included (this portion still in testing, and not fully reliable)
- @param string $email_reply_to_name Name of the "reply-to" header (defaults to store name if not specified, except for contact-us and order-confirmation)
- @param string $email_reply_to_address Email address for reply-to header (defaults to store email address if not specified, except for contact-us and order-confirmation)
**/
function zen_mail($to_name, $to_address, $email_subject, $email_text, $from_email_name, $from_email_address, $block=array(), $module='default', $attachments_list='', $email_reply_to_name = '', $email_reply_to_address = '' )
the $block array should have fields corresponding to the HTML version of the email being sent. More detail about how to compose that can be found in includes/classes/order.php within the function send_order_email or by using that function to send the email if it is an order email being sent.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...