Forums / General Questions / Newsletter won't send in HTML

Newsletter won't send in HTML

Locked
Results 1 to 20 of 77
This thread is locked. New replies are disabled.
23 Jan 2007, 06:29
#1
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Newsletter won't send in HTML

Admin gets emails just fine but I cannot send Newsletter emails in html format...the preview is fine, but it is recieved in plain text with the html stripped out. I have read everything I can find but can't find anything that solves the problem. Also the Admin email comes as plain text and also I have an account with a different email addy and it comes in plain text so I know the customers are getting plain text also. It's not just Admin email.

Admin->Configuration->Email Options->Send MIME HTML Email ....is set to TRUE
Admin->Configuration->Email Options->Admin Email Format .... set to html

Any ideas why the email sends in plain text?
23 Jan 2007, 09:04
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Newsletter won't send in HTML

1. What version of Zen Cart ?
2. What is your "Email Transport" method set to ? What happens if you try other options?
3. If you change the setting for "Email must send from known domain", does that help?
23 Jan 2007, 17:39
#3
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Re: Newsletter won't send in HTML

1. Zen Cart 1.3.6
2. sendmail...I can send an email to an individual customer as in Tools/Send Email and it sends just fine in html and is recieved just fine as html. So there's nothing wrong with the way it sends email therefore I don't want to mess with those settings.
3. tried that, no

Since all other types of email sends just fine as html and is recieved just fine as html, seems to me the problem is in the newsletter section somehow...
25 Jan 2007, 12:58
#4
urbanmaleclothing avatar

urbanmaleclothing

New Zenner

Join Date:
Oct 2006
Posts:
21
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Dizzie:

1. Zen Cart 1.3.6
2. sendmail...I can send an email to an individual customer as in Tools/Send Email and it sends just fine in html and is recieved just fine as html. So there's nothing wrong with the way it sends email therefore I don't want to mess with those settings.
3. tried that, no

Since all other types of email sends just fine as html and is recieved just fine as html, seems to me the problem is in the newsletter section somehow...

Mine is the same the HTML previews OK but gets lost en-route, I've tried it using the HTML form in the admin and by building an email first in the Coffeecup editor, niether works.

I sent them manually through Outlook Express now, bit of a chore but it's the only way it seems.

Regards Steve
25 Jan 2007, 17:09
#5
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Re: Newsletter won't send in HTML

I sent mine out and then found out it had stipped the the html...really embarrassing to the customers. Do you know how many hours it took to go thru every single customer information to make up a list of who is subscribed and who is not so I could send it out manually...yikes!
Guess there's no fix for it....so I removed it and put my own "Notify Me of New Products" form on the front page.
12 Feb 2007, 15:50
#7
n8pbm avatar

n8pbm

Zen Follower

Join Date:
Mar 2005
Posts:
142
Plugin Contributions:
0

Re: Newsletter won't send in HTML

My problem was that when I sent a newsletter to the admin it always arrived in plain text no matter what i tried. I fixed this issue by creating a customer with the same email address as the admin. Set the customer profile to HTML and now I can send HTML newsletters to the admin.

It appeared all the customers were getting the HTML newsletter when requested. It was just the admin that did not get it.

Seems strange that the settings has a spot to set the admin email option but it did not work. I am running 1.3.7 on Windows server.

Hope this helps. I searched the forum and did not find this solution.
12 Feb 2007, 20:02
#8
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Re: Newsletter won't send in HTML

I created an account as if I were a customer so I recieved the newsletter as the admin and also to another email address as a customer....So I know the customers are not getting the email in html.....since this is a problem with no fix, I had to remove use of the newsletter and go thru each customer setting individually and find the ones subscribed to the newsletter to get their email addy. Now I send a newsletter using OE. But I had to set up a mailing list they can subscribe to on the front page of the store in place of a newsletter.
15 Mar 2007, 20:25
#9
vb123 avatar

vb123

New Zenner

Join Date:
Mar 2007
Posts:
1
Plugin Contributions:
0

Re: Newsletter won't send in HTML

I am having the same problem and can't find a solution. Anyone? I've tried everything mentioned as well and still it's a no-go. Version 1.3.7 for me.
16 Mar 2007, 07:16
#10
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

For email or newsletters sent from Admin there is a potential problem with the constant 'EMAIL_ENCODING_METHOD' not being defined to '8bit'.
To fix this, copy the file email_use_8bit.php from /includes/extra_configures/ to /admin/includes/extra_configures/
Each folder should have a copy of the file..
16 Mar 2007, 11:50
#11
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Re: Newsletter won't send in HTML

why wasn't it fixed in v1.3.7?
16 Mar 2007, 20:39
#12
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Not sure I understand the question Dizzie.
I've been looking at this intermittently for several months, but a couple of days ago I got sufficiently annoyed with the anomalous behaviour to sit down and trace through what was happening.
Since actually getting the admin set to use 8bit on my mail server, mail and newsletters from admin all arrive at the 'problem' accounts in glorious html. It's quite possible that some sections were picking up the shop setting, but newsletters certainly wasn't.

Chuck
17 Mar 2007, 00:03
#13
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Chuckl:

For email or newsletters sent from Admin there is a potential problem with the constant 'EMAIL_ENCODING_METHOD' not being defined to '8bit'.
To fix this, copy the file email_use_8bit.php from /includes/extra_configures/ to /admin/includes/extra_configures/
Each folder should have a copy of the file..


I just meant if this fixes the problem, then I can't help but wonder why they didn't fix it in the the version they released since this thread...there's been alot of talk about this problem but yet no fixes for it....
17 Mar 2007, 00:22
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Newsletter won't send in HTML

Dizzie, did the suggestion fix the problem for you ?
17 Mar 2007, 04:51
#15
dizzie avatar

dizzie

Zen Follower

Join Date:
Jan 2006
Posts:
152
Plugin Contributions:
0

Re: Newsletter won't send in HTML

How would I test it? Send a fake newsletter out..if it doesn't work, then I look like an idiot AGAIN...if it does work then I still look like an idiot for the fake newsletter...??
17 Mar 2007, 11:50
#16
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Dizzie,

A caveat, I run my own servers so I have control over the setup, what is used or usable etc etc.

That said, the setup that produced the desired html newsletters is as follows:
Server - Ubuntu Linux 6.06 - 2.6.15-27
PHP 5.1.2
MySQL 5.0.22
Mail - Postfix, 8bit Mime enabled.
Zen Cart 1.3.7

In Admin, mail transport set to PHP, email linefeeds LF, use mime, send email, use archiving and friendly errors all set to true, as well as 'must send from known domain. Admin format set to HTML.
Editor used is FCKEditor.

What prompted my investigation was that the newsletters were always received as 7bit mime, despite it being set to 8bit, and that my mail server is also set to 8bit, and only reformats to 7 if the destination server cannot handle 8.
Since I was getting the mail off the same server Zen Cart was using, this seemed strange, and led to the discovery that newsletters were not picking up the transport method setting.

I have tested it with both Newsletter only subscriptions mod installed and without, and it seems to work fine, and tested to Gmail, Hotmail and some fairly strictly setup Outlook clients. All work.

With regard to how to test it, I've attached a functions_email.php which has been modified to force html on the admin user. i.e. if you select the administrator from the newsletter audience select, it will send the html newsletter, not the text version.
It is a brute force hack, just the 2 following pieces of dreadful code added:

$adm = 0;
$fndadm = 'ADMIN';
$adm = strpos($to_name,$fndadm);
if ($adm===false) $adm=0;
else $adm=1;
if ($adm > 0){
$customers_email_format = 'HTML';
}

if ($adm > 0) {
$mail->IsHTML(true);
$mail->Body = $email_html;
$mail->AltBody = '';

but it at least allows you to send test newsletters to admin.

I honestly don't remember whether I wrote this, or found it somewhere, so if I have appropriated someone elses code, I apologise, please let me know, and I will gladly give acknowledgement.
If you use the newsletter subs mod, shout and I'll send the file.

Rgds,

Chuck
21 Mar 2007, 03:47
#17
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Posts:
239
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Thanks Chuck.

That works for me.
21 Mar 2007, 04:10
#18
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Posts:
239
Plugin Contributions:
0

Re: Newsletter won't send in HTML

paul3648:

Thanks Chuck.

That works for me.


Sorry - I spoke too soon. The administation newsletter arrives OK, but I just set up two test accounts - one to Yahoo and one to my ISP address.

The Yahoo account received plain text - and all messed up too because it was converted from HTML.

Back to the drawing board...

This is unfortunate - I've converted an existing site over to Zen Cart and was hoping to have everything (including the newsletter) integrated.
21 Mar 2007, 07:27
#19
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Paul,
Glad you had at least some success! I don't use Yahoo mail at all, so I can't comment, but all web based email is touchy at best. Have you played around with the email preferences with you Yahoo mail?
Best practice guidelines seem to be to use tables, not CSS, and keep it simple. I also have a suspicion that HTMLArea tends to leave dangling HTML tags all over the place when you do a lot of editing, which is why I changed to FCKEditor, which seems cleaner. Purely subjective personal preference, and might be totally untrue.
The changes I mentioned in this thread do two things, enable 8bit mime from admin, which the web based mail services seem to prefer, and allow Admin html mail. When sending, the code checks the subscriber and customer tables for an email format. Since the admin user is a special case, nothing is found, and the code defaults to text based. The hack above detects the admin user and forces html mail.
My test emails consisted of several 2 or 3 column 1 row tables, with all images and text, and therefore divs, formatting etc in the tables.
Final thoughts, since you are getting what is obviously html as text, I would guess that it is yahoo mail that is stripping out the formatting. Also, were you sending to that Yahoo mail address as admin at all, or as a dummy customer?

Chuck
21 Mar 2007, 08:19
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: Newsletter won't send in HTML

Chuck,
Instead of the hacks you suggested, does this work correctly?
/includes/functions/functions_email.php
find this code:
      if (ADMIN_EXTRA_EMAIL_FORMAT == 'TEXT' && substr($module,-6)=='_extra') {
        $email_html='';  // just blank out the html portion if admin has selected text-only
      }
add this directly below it:
      // if no customer email record found, and admin email format is set to HTML, and sending newsletter, and admin is logged in, use HTML:
      if ($customers_email_format_read->RecordCount() == 0 && ADMIN_EXTRA_EMAIL_FORMAT == 'HTML' && in_array($module, array('newsletters', 'product_notification')) && isset($_SESSION['admin_id'])) {
        $customers_email_format = 'HTML';
      }