Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] U HTML Emails


Recommended Posts

Thank you so much for getting back with me - what a handy little trick...

 

Yes, I made sure that my settings were all set correctly (HTML, LF, etc.).

 

I've listed below the two dumps that I got when I executed the tep_mail - once with the vanilla message, once with the ultimate HTML. The vanilla one worked fine, while the new one did not. I've gone through and looked at the strings as closely as I can and yet I cannot see any difference.

 

Can you possibly take a look and see if anything jumps out at you?

 

Vanilla (worked):

 

object(email)(10) { ["html"]=> string(129) "A new password was requested from .

 

Your new password to 'ABC Products and Services' is:

 

xRsxxxMc

 

" ["text"]=> NULL ["output"]=> NULL ["html_text"]=> string(111) "A new password was requested from . Your new password to 'ABC Products and Services' is: xRsxxxMc " ["html_images"]=> array(0) { } ["image_types"]=> array(9) { ["gif"]=> string(9) "image/gif" ["jpg"]=> string(10) "image/jpeg" ["jpeg"]=> string(10) "image/jpeg" ["jpe"]=> string(10) "image/jpeg" ["bmp"]=> string(9) "image/bmp" ["png"]=> string(9) "image/png" ["tif"]=> string(10) "image/tiff" ["tiff"]=> string(10) "image/tiff" ["swf"]=> string(29) "application/x-shockwave-flash" } ["build_params"]=> array(5) { ["html_encoding"]=> string(16) "quoted-printable" ["text_encoding"]=> string(4) "7bit" ["html_charset"]=> string(10) "iso-8859-1" ["text_charset"]=> string(10) "iso-8859-1" ["text_wrap"]=> int(998) } ["attachments"]=> NULL ["headers"]=> array(2) { [0]=> string(17) "MIME-Version: 1.0" [1]=> string(27) "X-Mailer: osCommerce Mailer" } ["lf"]=> string(1) " " }

Warning: Cannot modify header information - headers already sent by (output started at /home/hgdadmin/public_html/catalog/includes/functions/general.php:1021) in /home/hgdadmin/public_html/catalog/includes/functions/general.php on line 33

 

 

Ultimate HTML (did not work):

object(email)(10) { ["html"]=> string(500) "

 

Dear Lxxxx Gxxxx,

 

A new password was requested from .

 

Your new password to ABC Products and Services is:

 

KxxxxxxP

 

Regards,

ABC Products and Services (http://www.abc.com/catalog/)

 

" ["text"]=> NULL ["output"]=> NULL ["html_text"]=> string(200) "Dear Lxxxx Gxxxx,A new password was requested from .Your new password to ABC Products and Services is: KxxxxxxPRegards,ABC Products and Services (http://www.abc.com/catalog/)" ["html_images"]=> array(0) { } ["image_types"]=> array(9) { ["gif"]=> string(9) "image/gif" ["jpg"]=> string(10) "image/jpeg" ["jpeg"]=> string(10) "image/jpeg" ["jpe"]=> string(10) "image/jpeg" ["bmp"]=> string(9) "image/bmp" ["png"]=> string(9) "image/png" ["tif"]=> string(10) "image/tiff" ["tiff"]=> string(10) "image/tiff" ["swf"]=> string(29) "application/x-shockwave-flash" } ["build_params"]=> array(5) { ["html_encoding"]=> string(16) "quoted-printable" ["text_encoding"]=> string(4) "7bit" ["html_charset"]=> string(10) "iso-8859-1" ["text_charset"]=> string(10) "iso-8859-1" ["text_wrap"]=> int(998) } ["attachments"]=> NULL ["headers"]=> array(2) { [0]=> string(17) "MIME-Version: 1.0" [1]=> string(27) "X-Mailer: osCommerce Mailer" } ["lf"]=> string(1) " " }

Warning: Cannot modify header information - headers already sent by (output started at /home/hgdadmin/public_html/catalog/includes/functions/general.php:1021) in /home/hgdadmin/public_html/catalog/includes/functions/general.php on line 33

Link to comment
Share on other sites

OK... an interesting little bit of news.

 

I came across the following thread: http://www.oscommerce.com/forums/index.php?sho...ic=69387&hl=

 

In it, Jason said the following:

 

For any who want to test that method before making the changes can do so this way.. For everyone who says the emails says it sent successfully but never arrives at the email this will apply to you. Instead of trying to send the email to a yahoo or hotmail account instead try to send an email to account that on your server or hosting account.. So for example if you own mysite.com you should try sending an email to [email protected] and I think you will see that the email does arrive just as its supposed to.. It reaches it destination in this case because the headers never had to be verified because it never actually left the server. However when you try to send emails to off server email accounts it does not work..

 

If you run that little test there and get the results just as I stated them then SHERIDAN's fix (below) listed above should work out fine for you.. Email headers have to be verified as a security constraint on spam on a lot of new hosting providers now.. Actually to those who are not experiencing this problem in my own opinion just means your hosting provider is a little behind the times perhaps..

 

...

 

The two files to change are:-

 

catalog/includes/functions/general.php

catalog/admin/includes/functions/general.php

 

Use the second code change I posted earlier not the first i.e. :-

$returnpath="Return-Path: <$from_email_address>";

$replyto="Reply-To: <$from_email_address>";

$mailerreplyreturn = array(1 => 'X-Mailer: osCommerce Mailer', $returnpath, $replyto);

 

Well, I tried his suggestion and found that that is indeed my problem. When I try to send the email to one on my own server - I get the email to go through just fine. However, to my home email address.... no good.

 

I tried to make the change that he suggested, but it still did not cure my problem.

 

Does his solution make sense to you? Can you think of anything else that I may be able to do along those lines that might cure my problem?

 

Thanks,

Moez

Link to comment
Share on other sites

OK.... last update. Toss away all of the other stuff that I was saying.

 

When I removed the following <head> line from password_forgotten.php:

 

<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

 

everything started working....

 

Does anyone have any ideas why that would be the case? I'm just afraid that I fixed one thing and broke something else.

 

Thanks,

Moez

Link to comment
Share on other sites

...that that is indeed my problem. When I try to send the email to one on my own server - I get the email to go through just fine. However, to my home email address.... no good.

 

Is the 'to' address (or other fields?) different in your two test cases (Vanilla and U HTML)?

 

What is more different? Two systems?

 

If it is one system, what do you change to get from vanilla to U HTML and back?

(do you entirely (re-)install U HTML?)

 

You can test if with U HTML and insert manually all vars in: $message->send('name', '[email protected]', 'name2', '[email protected]', 'subject');

 

If this does not work try the dump just before $message->send and see if vanilla and U HTML differ.

And the [output] => --=_a23c.... is most important (this is the message body with text/plain and text/html.

 

I guess the problem for is not in the 'html', but the vars in ->send.

 

There are a lot of checks done before the address (and other feilds) is accepted.

You can find them here: includes/classes/email.php and function send (almost at the end).

 

Good luck...

Link to comment
Share on other sites

<head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>

Are the " on the right place?

-> <head><meta http-equiv="Content-Type" content=text/html; charset="iso-8859-1"></head>

 

In my [output] it is: Content-Type: text/html; charset="UTF-8"

 

How does U HTML changed this?

Edited by mixit
Link to comment
Share on other sites

Are the " on the right place?

-> <head><meta http-equiv="Content-Type" content=text/html; charset="iso-8859-1"></head>

 

In my [output] it is: Content-Type: text/html; charset="UTF-8"

 

How does U HTML changed this?

 

 

OK.... Now I'm really stumped. This is the thread for http://addons.oscommerce.com/info/5825 , right? I just re-checked the contribution package and they are all charset=iso-8859 way back to the beginning.

 

That said, when I changed it to UTF-8, everything worked like a charm....

 

What am I missing? Am I in the wrong place?

Link to comment
Share on other sites

You are completely on the right spot.

 

The 'setting' for CHARSET is done in the language-file.

For me: includes/languages/english.php

 

You will find:

// charset for web pages and emails
define('CHARSET', 'UTF-8');

If no CHARSET is found I think it is set to iso-8859.

 

So, actually U HTML does not change standard ocS.

 

Conclusion: U HTML users must set CHARSET to UTF-8?

Edited by mixit
Link to comment
Share on other sites

So, actually U HTML does not change standard ocS.

 

Conclusion: U HTML users must set CHARSET to UTF-8?

 

Well, I may have been a little premature in my excitement. When I changed the charset in the <head> tag in the BASIC modules, everything worked OK. But, when I did that to the green or the stripes modules... it still did not work. Well, it worked, but only to my email accounts that are housed on my hosts server ([email protected]).

 

So, I still have to play with it a bit to find out which bit of HTML is making the tep_mail function unhappy. I think however, I'm just going to start slowly building on to the basic modules until I can get them looking the way I like (since, they're already working).

 

Anyway, thank you very much for your helpful advice, Patrick. I think I may just decide to be fat, dumb and happy and decide not to pursue this a whole lot more if I can get those basic modules up and running.

 

Thanks again!

Moez

Link to comment
Share on other sites

... the green or the stripes modules... it still did not work.

I think however, I'm just going to start slowly building on to the basic modules until I can get them looking the way I like (since, they're already working).

... if I can get those basic modules up and running.

Moez,

Although the green and strips worked for me (technically), I also setup a new template for two reasons:

- now I was able to match the mail to my site (and it has no green or stripes B) )

- email readers interpret html very differently and I want to make it robust

 

I make use for the basis for my html from: http://www.mailchimp.com/resources/templat...c_template.html

Download page

 

These articles helped me a lot:

http://www.campaignmonitor.com/design-guidelines/

http://reachcustomersonline.com/2004/11/11/09.27.00/

 

..and... test, test, TEST!!!

(the free test at campaignmonitor.com I did not used yet)

Link to comment
Share on other sites

Hello sorry for my englsih I'm french guy,

 

I install the contribution but I have a problem, when I create a news user I have this error:

 

"Warning: mail(): SMTP server response: 554 <[email protected]>: Relay access denied in c:\www\catalog\includes\classes\email.php on line 520

 

Warning: Cannot modify header information - headers already sent by (output started at c:\chti-scrap\www\catalog\includes\classes\email.php:520) in c:\chti-scrap\www\catalog\includes\functions\general.php on line 33"

 

I change the mail adress

 

And I have another problem in admin section order:

 

"Fatal error: Call to undefined function: tep_hide_session_id() in c:\chti-scrap\www\catalog\admin\orders.php on line 401"

 

the code line 401 is:

	 <?php echo tep_hide_session_id(); ?></form></tr>

Link to comment
Share on other sites

  • 2 weeks later...

Maybe this is already included in the pack but i have nor found here any answer about it, sorry if its there, i did not see it.

 

From the admin tool there is an option to send email. Does this contrib can change the aspect of the email send from admin section.

how can i implement it?

has anyone done this . Any help will be welcome.

 

Thanks in advance.

If you are not part of the solution, you are part of the problem

Link to comment
Share on other sites

I am wondering the same as the above post.

 

I have this fantastic contrib. installed and it works perfectly for orders, new customers, and such.

 

I would really like to be able to send HTML email from the admin "send email" where I can choose individual customers, newsletter subcribers only, or all customers. I am not sure if I missed something during install, or if this is just not a capability of this contribution? I bet it's something simple I am not seeing, if someone could point me in the right direction I sure would appreciate it.

Link to comment
Share on other sites

I'm with Rob - I use that feature a lot! :)

 

Here's my issue. I had my first customer attempt to sign up (create an account) and they got an HTTP 500 error page when they hit the 'continue' button. Their account was created, however, they just didn't know it. I narrowed it down to this contribution. When I removed the UHTML parts from the create_account file, the sign-up goes as expected. What could be causing the problem?

 

Thanks!

Link to comment
Share on other sites

Is it possible to add banners to emails?

 

I added

$html_email .= '<td><font face="Times New Roman, Times, serif" style="font-size:14px;">' . tep_display_banner('static', BOX_AD_BANNER_TYPE2_2) . '<br />' .'</font></td>

 

but I got an error

TEP ERROR! (tep_display_banner(static, banner2_2) -> Banner with ID 'banner2_2' not found, or status inactive

................

banner data is in the database what do I need to add that this will work

 

I use this code for may info box banners

 

<!-- banner-ad-in-a-box //-->

<?php

if ($banner = tep_banner_exists('dynamic', BOX_AD_BANNER_TYPE2_2)) {

?>

 

<td>

 

<?php

$bannerstring = tep_display_banner('static', $banner);

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'left',

'text' => BOX_AD_BANNER_HEADING5

);

 

 

$info_box_contents = array();

$info_box_contents[] = array('align' => 'center',

'text' => $bannerstring

);

new infoBox($info_box_contents);

?>

</td>

 

<?php

}

?>

<!-- banner-ad-in-a-box_eof //-->

Link to comment
Share on other sites

This is an html email contribution for osCommerce Online Merchant [2.2rc2]. It will replace the standard emails with emails that have more advanced layout and design. The contribution allows you to have different "html email layouts" installed at the same time. New layouts can easily be created and installed. You can easily change between the different "html email layouts" from a dropdown menu, "E-Mail Options"->"Html Email Layout", in the admin panel.

 

 

Hello Olof,

 

Firstly, thanks for making such a clean looking contribution! The stock emails from oscommerce do not look very appealing and these ones look awesome! I recently installed this contribution and have been testing it. The *.htm file that it saves for development works great and looks exactly what I want the emails to look like (from the images you included); however, the actual received emails look like the following screenshot:

http://img216.imageshack.us/img216/848/storeemailrv8.png

Any idea why this might be happening?

 

Thanks,

 

J

Link to comment
Share on other sites

  • 2 weeks later...
Hello Olof,

 

Firstly, thanks for making such a clean looking contribution! The stock emails from oscommerce do not look very appealing and these ones look awesome! I recently installed this contribution and have been testing it. The *.htm file that it saves for development works great and looks exactly what I want the emails to look like (from the images you included); however, the actual received emails look like the following screenshot:

http://img216.imageshack.us/img216/848/storeemailrv8.png

Any idea why this might be happening?

 

Thanks,

 

J

 

 

Does anyone have any idea why the emails look like this? I don't understand why the email is pulling in everything that is included in the checkout_process.php even though its not included when the $html_email variable is defined. Sorry, i'm just terribly lost and frustrated =(

 

J

Link to comment
Share on other sites

  • 2 weeks later...
Does anyone have any idea why the emails look like this? I don't understand why the email is pulling in everything that is included in the checkout_process.php even though its not included when the $html_email variable is defined. Sorry, i'm just terribly lost and frustrated =(

 

J

Hi J,

 

I do not precise understand your question, but the screenprint looks like the text-plain (for non-html email) and text-html (for html email) is displayed.

Or do you meant the checkout_process e-mail is displayed in a other e-mail (like create_account)?

 

If you use html and it is too complex (read: not basic html) e-mail programs can interpret it in a way you did not intended.

 

To set up a layout it is very important to start with a minimum design, text, fields and tables.

If this works you can add whatever you like, but one step at a time and: test, TEST, test .... and test again...

Link to comment
Share on other sites

I am wondering the same as the above post.

 

I have this fantastic contrib. installed and it works perfectly for orders, new customers, and such.

 

I would really like to be able to send HTML email from the admin "send email" where I can choose individual customers, newsletter subcribers only, or all customers. I am not sure if I missed something during install, or if this is just not a capability of this contribution? I bet it's something simple I am not seeing, if someone could point me in the right direction I sure would appreciate it.

Hi Rob,

 

My store is not yet live, but I do also think I is very helpful if it is also possible to use it in admin/send email.

 

After I put it together I will post my solution here, I hope within a few weeks...

Link to comment
Share on other sites

Hi J,

 

I do not precise understand your question, but the screenprint looks like the text-plain (for non-html email) and text-html (for html email) is displayed.

Or do you meant the checkout_process e-mail is displayed in a other e-mail (like create_account)?

 

If you use html and it is too complex (read: not basic html) e-mail programs can interpret it in a way you did not intended.

 

To set up a layout it is very important to start with a minimum design, text, fields and tables.

If this works you can add whatever you like, but one step at a time and: test, TEST, test .... and test again...

 

 

Hi Mix, thanks for the reply!

 

After your response, I think you are right and it is sending both the plain text and html in the email. Any idea why this might be happening? I followed the install directions very closely, but im sure its possible i could have made a mistake somewhere. I don't have much experience with html emails but i was using the templates provided with the contribution. Also, do i need to attach the images used for the backgrounds of the tables in order for them to be displayed (like in the included 'stripes' template) ? Any help is appreciated, I just feel very lost considering i have such little experience in sending HTML emails =/ I guess it could just start making my own templates, but I'm a big confused about how to call stuff from the database and insert it into the email.

 

Thanks, i'll reply again once i mess around with it a bit more.

 

J

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...