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

Newsletter won't send in HTML

Locked

Views: 39,909

Results 21 to 40 of 77
This thread is locked. New replies are disabled.
21 Mar 2007, 8:36 AM
#21
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Newsletter won't send in HTML

DrByte,
I'll give it a try shortly and report back.
I have been intentionally calling it a hack, because it's just that - brute force code to handle a special case, and I'd much rather the default code catered for and removed the special case. Not that too many people have first or last names of 'ADMIN', but you never know...

Chuck

21 Mar 2007, 8:59 AM
#22
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Newsletter won't send in HTML

Valid points.

My proposed change doesn't rely on the word "admin" in the email address. Instead, it depends on the specified email address not being tied to any existing customer records.
Note when sending out newsletter emails, you have the option to send to the email address of the currently-logged-in administrator. As long as this email address isn't already tied to a customer in the store, this approach will allow HTML messages to be sent by default when testing sending the newsletter to the admin.

Of course, if there is a customer record with the same email address as the administrator, all you need to do is edit that customer's preference for email format, and you're also all set.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Mar 2007, 9:00 AM
#23
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

DrByte,
Yes, that seems to work fine. I'd purposely avoided any reference/use of ADMIN_EXTRA_EMAIL etc as it was referenced only in the context of the admin copy emails, and I felt any change in that was best left to the developers.
Thanks,

Chuck

21 Mar 2007, 9:01 AM
#24
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Newsletter won't send in HTML

Great. This alteration will find its way into a future release ...

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

21 Mar 2007, 9:54 AM
#25
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

To sum up, and consolidate everything into 1 post -

To increase the chances of emails sent from admin as HTML actually arriving as HTML, particularly to webmail based email systems such as hotmail, yahoo mail, gmail etc.; and to allow test newsletters sent to the admin email address to arrive as HTML, do the following:

Copy /includes/extra_configures/email_use_8bit.php to /admin/includes/extra_configures, so that both folders have a copy of the file.
Replace /includes/functions/functions_email.php with the attached copy, which incorporates DrBytes' suggested changes.

Chuck

21 Mar 2007, 1:16 PM
#26
paul3648 avatar

paul3648

Zen Follower

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

Re: Newsletter won't send in HTML

Chuck and Dr. Byte,

I've just applied the latest patch file and run a test again on my Yahoo account and received the HTML newsletter correctly, so all seems to be fixed.

Thanks!

21 Mar 2007, 2:14 PM
#27
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Thats great to hear! Thanks for the feedback

Chuck

27 Mar 2007, 3:21 AM
#28
austy25 avatar

austy25

Zen Follower

Join Date:
Feb 2006
Posts:
248
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Thank you very much it works great :)

Take scrapbooking to a whole new level - GO DIGITAL - http://www.hookedondigiscrap.com

29 Jun 2007, 8:40 PM
#30
tbrides avatar

tbrides

Zen Follower

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

Re: Newsletter won't send in HTML

hi,
Dont know if anybody is following this thread still :)

i applied the fix. but it didnt seem to work for me.
i have the mod for newsletter only subscribers installed , so the problem may lie there.
is anybody willing to look at the file for me if I PM them?

thanks,
Tom

29 Jun 2007, 10:50 PM
#31
tbrides avatar

tbrides

Zen Follower

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

Re: Newsletter won't send in HTML

Hi,
spoke too soon.

I got it working :)

Forgot to change in Configuration -> Email Options

Use MIME HTML When Sending Emails = true

Just to let anybody else know.
Thanks all

29 Jul 2007, 10:41 PM
#32
laney avatar

laney

New Zenner

Join Date:
Sep 2006
Location:
Ontario, Canada
Posts:
62
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Is this fix for email only or for the newsletter?

my store
my blog

"Faith is going all the way to the edge of all you can do, then taking one more step"

15 Aug 2007, 4:10 PM
#33
high2k avatar

high2k

Zen Follower

Join Date:
May 2006
Location:
Scotland
Posts:
198
Plugin Contributions:
0

Re: Newsletter won't send in HTML

I have made Dr Byte's suggested amendments but still find that I cannot receive html emails - they just arrive blank. Any ideas?

15 Aug 2007, 10:46 PM
#34
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Newsletter won't send in HTML

high2K:

I have made Dr Byte's suggested amendments but still find that I cannot receive html emails - they just arrive blank. Any ideas?

Are you referring to all emails, or just newsletters?
This discussion thread is specific to newsletters.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 Aug 2007, 6:37 AM
#35
high2k avatar

high2k

Zen Follower

Join Date:
May 2006
Location:
Scotland
Posts:
198
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Ah! I've been using 'Send email' as the test. I've just sent a newsletter to admin and it arrived [although it had been converted to plain text in the process and delivered to my spam folder, but perhaps that's due to my own email settings on my PC??].
So thanks for the fix, but why isn't the 'send email' working with html emails?

16 Aug 2007, 7:14 AM
#36
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

High2k,
Don't think we've asked this yet, in Admin-Config-Email Options do you have 'Use MIME HTML when sending emails' set to true?

16 Aug 2007, 7:18 AM
#37
high2k avatar

high2k

Zen Follower

Join Date:
May 2006
Location:
Scotland
Posts:
198
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Chuckl:

High2k,
Don't think we've asked this yet, in Admin-Config-Email Options do you have 'Use MIME HTML when sending emails' set to true?

Sure do.

16 Aug 2007, 11:51 AM
#38
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

OK, if some mail is getting through it means that it is possible to send mail, even if the HTML is being lost along the way. ( hope you have Admin email format set to HTML?
Check the headers on the email/newsletter you received - in Outlook, open the email, then file-properties-details-message source. If there is a return path, reply to or a received from or similar with <nobody> listed, you need to try and get 'Emails must send from known domain' working.
If you are using PHP as the mail transport, switch to sendmail -f to see if that works.
You also need to ensure that there is an Emails sent FROM address defined in email options.
Does your hosting co. have any guidelines or recommendations as to the recommended email setup?

16 Aug 2007, 5:46 PM
#39
high2k avatar

high2k

Zen Follower

Join Date:
May 2006
Location:
Scotland
Posts:
198
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Hi,

I don't have the 'detail' option in Outlook. I just have properties > general.
However, I do note that where it says 'message type' it says plain text. Surely it should say rich text or html?
In admin, email format has alwys been set to HTML, and email sent from has always had an address.
I also notice that if I send a rich text message that only has text in it, then the text does come through, but it is unformatted. If I add an image to the email then the image does not appear at all - not even the little missing image box that we're all used to.
It therefore appears that although I have selected html emails, they are just defaulting to plain text.

16 Aug 2007, 7:51 PM
#40
chuckl avatar

chuckl

Totally Zenned

Join Date:
Nov 2006
Location:
Papworth, Cambridgeshire, UK
Posts:
717
Plugin Contributions:
0

Re: Newsletter won't send in HTML

Normally yes, but not necessarily. You mentioned implementing Dr. Bytes fix in an earlier post. Were you referring to this - referenced in post 20 in this thread?

// 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';
}

If you don't have that in place, all admin emails go out as plain text.
On customer mail, I seem to remember that the default is also text.
Setting a 'FROM' email address is also of limited use unless 'Send from known domain' is also set to true, as this gets rid of 'nobody' as the mail source.
Unfortunately, that requires having a mail transport that would allow it.
At this stage I'd say ask your hosting company what mail settings they suggest to allow you to send HTML mail, and set reply to and envelope from addresses