Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

error: use mime html when sending email, why


yanarasod

Recommended Posts

Posted

this option: use mime html when sending email, in admin>configuration>email. why is this needed. i thought it might be needed to send email in html, but when i used contact_us and send email to customers via admin, the email were not in html, so why is this option needed, please tell, as i want to customize my orde confirmation, create accounts and other email.

Posted

when that option is on things like the newsletters and in general emails originated from the store do include html. Of course the email content should include it too.

Posted

but the email of create account succes and order confirmation etc, do not include html, even if i give <b> <br> and such simple html. but newsletter are sent in html even if this feature is disabled

Posted

Well it does that's what I see here. You could debug the tep_mail function and make sure it uses the add_html member of the email class. Other than that the email program you're using should have an option to switch on html on emails and you should see it.

Posted

hey will it allow me to send email of order confirmation , create account etc in html, also i dont want it to allow to send html email via contact_us.php or else it might be security risk. please can you explain, as i want to send customized order emails, i am using <b> <br> tags but they are displayed as in order email with out making text bold, or adding line break.

Posted
hey will it allow me to send email of order confirmation , create account etc in html, also i dont want it to allow to send html email via contact_us.php or else it might be security risk. please can you explain, as i want to send customized order emails, i am using <b> <br> tags but they are displayed as in order email with out making text bold, or adding line break.

 

I would also like to know the answer to the html issue. I have enabled it in the admin panel and then sent a email to my self fully loaded with html and it came out looking like I was using a html editor.

Posted

i have got one answer we can't text bold in order, create account etc. emails but we can certainly make a line break by \n adding this slash n without any spaces e.g. He is good\nhe is nice. but does anyone know how to make text bold

Posted
i have got one answer we can't text bold in order, create account etc. emails but we can certainly make a line break by \n adding this slash n without any spaces e.g. He is good\nhe is nice. but does anyone know how to make text bold

 

It does send html. Just look the email class file and you will see all kinds of support for html. I have this enabled on my store and I can see the html code coming right through the email message for create account for instance.

Posted

hey i do understand what you mean to say, there are some lines in email.php where \n and \r are defined, so do i need to add <b> there to make text bold. please can you tell me these two things,

 

1. how to add image

2. make text bold

 

also i would like to know that is it going to enable html in contact_us form, i dont want html there, or spammers may do something wrong

 

please see this code below, i think this is the one where we should define what html codes be supported

 

/**
* Adds plain text. Use this function
* when NOT sending html email
*/

function add_text($text = '') {
  $this->text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);
}

/**
* Adds a html part to the mail.
* Also replaces image names with
* content-id's.
*/

function add_html($html, $text = NULL, $images_dir = NULL) {
  $this->html = tep_convert_linefeeds(array("\r\n", "\n", "\r"), '<br>', $html);
  $this->html_text = tep_convert_linefeeds(array("\r\n", "\n", "\r"), $this->lf, $text);

  if (isset($images_dir)) $this->find_html_images($images_dir);
}

/**
* Adds an image to the list of embedded
* images.
*/

function add_html_image($file, $name = '', $c_type='application/octet-stream') {
  $this->html_images[] = array('body' => $file,
							   'name' => $name,
							   'c_type' => $c_type,
							   'cid' => md5(uniqid(time())));
}

Posted

Yea but the contact us form does not send html because there is no html translation same for the reviews and in general from visitor's input. Spammers use email fields to populate the carbon copy for instance. So in other words html is stripped because of the sanitize string function the osc uses to filter it. When you send a create account email however you could include html for the email body exactly the same way you do when you write html for a regular page.

 

for an html image its

<img="source_image_full_url">

Posted

but hey i did it. after setting allow html under admin to true, i tried using <b> but it didn't make the text bold instead i recieved the email as it was with <b> included

Posted

somethine else is going on. if you see the html tags on the email you receive then you should be ok. It's your email program simply does not translate it. Check if there is a switch to view the content as html.

 

And another thing you could is to send a regular email with html in it. You should probably see the same problem. I doubt its osc related.

Posted
somethine else is going on. if you see the html tags on the email you receive then you should be ok. It's your email program simply does not translate it. Check if there is a switch to view the content as html.

 

And another thing you could is to send a regular email with html in it. You should probably see the same problem. I doubt its osc related.

I normally receive emails in html format and never see the html code. I have set up a mailing list seperate to OSC and that is all in html and never have a problem. So it must be somewhere related to OSC if I can't send an email in html without seeing the code when it's received.

 

Trev <_<

Posted

hey now the email was sent in html when i removed \n it showed text in bold, but then how do i add a line break i tried <br> but it didnt work.

 

and one more thing, if i set up my email via SMTP is it going to be a problem.

Posted

I also have this problem.

 

All mails - whether from the tools-send email or the order confirmation come through as plain text.

I send/recieve HTML mail all the time through Outlook 2003, so its definately OSC related.

 

In the data base there is the settings to use HTML mail which is set to true (also on the config page under 'my store')

 

I have tried editing email.php to no avail :(

 

HELP!!!!

Posted

i now send all my emails in html easily, just turn on html in admin, then use html in whatever way, but what i did was used . \n" . this ways bcoz if i include it directly then no html is shown. goodluck

Posted

Can you explain the \n thing?

Did you put it directly in the body of the mail??

 

I want to embed an image as a signature (it's uploaded into my images dir) but using the code <img src='imagename.jpg'></img> just shows the code :(

Posted

More info:

The mail comes as a text/plain type!

I have examined the source code of the mail to verify...

Looks like HTML is not enabled ?

It IS enabled in the control panel and the database??

 

Stuck now!!

Posted

enable html from admin

 

use html line break for space and html img linking or whatever you want can be achived via simple html, if you dont know that kick off

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...