473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 <we*******@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
Nov 2 '07 #1
2 2994
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 <we*******@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
Nov 2 '07 #2
I figured it out. I just had to get rid of this line:

$mail->setText($message);

Thanks all.

--
Shelly
Nov 2 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Roswitha Schoppe-Jantzen | last post by:
Hallo The Class htmlMimeMail (from de.comp.lang.php.* FAQ) does not work with PHP 4.3.3, before with PHP 4.2.3 it went well. If I send a PDF-file with PHP 4.3.3, the mail is send, but the...
3
by: Markus Weber | last post by:
Hi, we use htmlMimeMail-2.5.1 (http://www.phpguru.org/mime.mail.html) to send mails. If I send an e-mail with the subject "Das Öl - Öl Öl - Ö Ä Ü ß - test test" I will receive an e-mail with...
2
by: vishal | last post by:
today i read about sending mail using including file htmlMimeMail.php but i don't know from where to download this file pls tell me url of file thxs for help in advance..
0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A base class... BaseClass bc = new ChildClass();...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about the article. The problem is: I the comment length...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.