htmlMimeMail problem

This is a discussion on htmlMimeMail problem within the PHP Language forums, part of the PHP Programming Forums category; I am having a little problem with htmlMimeMail. Previously, I had been using a class that sent text email. I ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-02-2007
Shelly
 
Posts: n/a
Default htmlMimeMail problem

I am having a little problem with htmlMimeMail. Previously, I had been
using a class that sent text email. I need to send an html mail and I am
using this class (php is version 4). What I receive is a plain text email.
When I ask Outlook Express to show that email in html, it still shows as
plain text. Other email I receive I can view in html, so that is not the
problem. The problem is that html is not being sent out. The html part IS
being composed correctly, because I echoed it on the page after the send
command ant it is fine. So, can someone see what I am doing wrong here? I
will include the essentials of the code.

define('MAIL_FROM', "name <webmaster@example.com");
define('MAIL_TO', 'my_email_address');
$mail = new htmlMimeMail();
$mail->setFrom(MAIL_FROM);
....build the text message as $message
....build the html message as $html
$mail->setText($message);
$mail->setHTML($html);
$sent = $mail->send(array(MAIL_TO));
....check on $sent
....echo the $html

I also tried with
$mail->setHTML($html, $message);

I have looked on the internet for examples to see if I am missing some line
(such as to say that this is an html email). So far, nothing.

--
Shelly


Reply With Quote
  #2 (permalink)  
Old 11-02-2007
Shelly
 
Posts: n/a
Default Re: htmlMimeMail problem

Shelly wrote:
> I am having a little problem with htmlMimeMail. Previously, I had
> been using a class that sent text email. I need to send an html mail
> and I am using this class (php is version 4). What I receive is a
> plain text email. When I ask Outlook Express to show that email in
> html, it still shows as plain text. Other email I receive I can view
> in html, so that is not the problem. The problem is that html is not
> being sent out. The html part IS being composed correctly, because I
> echoed it on the page after the send command ant it is fine. So, can
> someone see what I am doing wrong here? I will include the
> essentials of the code.
> define('MAIL_FROM', "name <webmaster@example.com");
> define('MAIL_TO', 'my_email_address');
> $mail = new htmlMimeMail();
> $mail->setFrom(MAIL_FROM);
> ...build the text message as $message
> ...build the html message as $html
> $mail->setText($message);
> $mail->setHTML($html);
> $sent = $mail->send(array(MAIL_TO));
> ...check on $sent
> ...echo the $html
>
> I also tried with
> $mail->setHTML($html, $message);
>
> I have looked on the internet for examples to see if I am missing
> some line (such as to say that this is an html email). So far,
> nothing.


Here is part of the message header I am receiving:

MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit

Note that is is sending text/plain.

--
Shelly


Reply With Quote
  #3 (permalink)  
Old 11-02-2007
Shelly
 
Posts: n/a
Default Re: htmlMimeMail problem

I figured it out. I just had to get rid of this line:

$mail->setText($message);

Thanks all.

--
Shelly


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:08 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0