By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,140 Members | 1,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,140 IT Pros & Developers. It's quick & easy.

Why cannot send the MIME html e-mail to gmail?

P: n/a
hello guys, i have met a problem that i can send the html e-mail by
using MIME via php to yahoo mail and hotmail, but when i was try to
send to gmail, it show all the html coding.
can someone help me to solve this kind of problem? thank you
the coding i made----->:

<?php
$a=<<<A
<form action="" method="post">
<input type="submit" name="submit" value="submit">
</form>
A;
echo $a;
if(isset($_POST['submit']))
{
$to = 's*******@gmail.com,st*******@yahoo.com';

$subject = 'Testing';

$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body bgcolor="gray">
<p>MIME email!</p>
</body>
</html>
';

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1'."\r\n";
$headers .= 'Content-Transfer-Encoding: 7bit'."\r\n";

$headers .= 'From: ck <st*******@yahoo.com>' . "\r\n";

mail($to, $subject, $message, $headers);
echo "Email had been sent!";
}
?>

your kindly help is important to me! ^_^

Apr 25 '06 #1
Share this Question
Share on Google+
13 Replies


P: n/a
"stam" <st******@gmail.com> wrote:

hello guys, i have met a problem that i can send the html e-mail by
using MIME via php to yahoo mail and hotmail, but when i was try to
send to gmail, it show all the html coding.
can someone help me to solve this kind of problem? thank you


Well, your e-mail headers are valid. If you will permit the obvious
question, is your gmail account configured to display HTML email?

You might try making the email multipart/alternative with a text/plain
section and a text/html section. You shouldn't have to do that, but it's
the most common way to do HTML mail.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Apr 27 '06 #2

P: n/a
Thank you for giving me a solution, but how to making the section,
because when i using boundary gmail also show whole coding that i
writen. Can u post the example for me.
Thanks again for your kindly help. ^^

Apr 29 '06 #3

P: n/a
"stam" <st******@gmail.com> wrote:

Thank you for giving me a solution, but how to making the section,
because when i using boundary gmail also show whole coding that i
writen.


Again I ask, are you sure that your gmail account is configured to display
HTML e-mail at all?
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Apr 29 '06 #4

P: n/a
I didn't configured anything in gmail, is it default to display HTML
email?
and where to configured it? because i cannot find it.

Apr 29 '06 #5

P: n/a
"stam" <st******@gmail.com> wrote:
I didn't configured anything in gmail, is it default to display HTML
email?
and where to configured it? because i cannot find it.


I don't know gmail at all, but the symptoms you describe seem to imply that
that gmail is just not displaying HTML email. Do you get ANY HTML email
that is displayed correctly?
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 1 '06 #6

P: n/a
yes, i get html email before, and it is display like html format, but i
just dun understand that why i can't send the html email to gmail, i
just can't figure out what happen? my supervisor is rushing me to
handle this problem as soon as possible, i'm having headache right now!
Could someone help me on this! thank you

May 3 '06 #7

P: n/a
Hello,

on 05/03/2006 02:32 AM stam said the following:
yes, i get html email before, and it is display like html format, but i
just dun understand that why i can't send the html email to gmail, i
just can't figure out what happen? my supervisor is rushing me to
handle this problem as soon as possible, i'm having headache right now!
Could someone help me on this! thank you


Your are probably not composing it correctly. You may want to try this
class for composing and sending e-mail message according to the Internet
standards.

http://www.phpclasses.org/mimemessage
--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
May 4 '06 #8

P: n/a
"stam" <st******@gmail.com> wrote:

yes, i get html email before, and it is display like html format, but i
just dun understand that why i can't send the html email to gmail, i
just can't figure out what happen? my supervisor is rushing me to
handle this problem as soon as possible, i'm having headache right now!

Could someone help me on this! thank you


There was nothing wrong with your original headers. The only thing I can
suggest is witchcraft and superstition: move the "From" header before
MIME-Version, add a "To" header specifically, etc.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 5 '06 #9

P: n/a
Thanks for your help. but i still cannot send it to gmail. Haiz~ is
this my fate or what! it just can't success............ Thanks for your
guys helping, but i still need solutions to solve this.

May 8 '06 #10

P: n/a
"stam" <st******@gmail.com> wrote:

Thanks for your help. but i still cannot send it to gmail. Haiz~ is
this my fate or what! it just can't success............ Thanks for your
guys helping, but i still need solutions to solve this.


Is your web site publicly available anywhere? I'd love to have it send an
e-mail directly to me so I can examine the actual headers that it sent.
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 10 '06 #11

P: n/a
i'm still testing the function, so it still didn't publicly. or u just
give me ur email address so i just send it to u. thanks

May 10 '06 #12

P: n/a
i'm still testing the function, so it still didn't publicly. or u just
give me ur email address so i just send it to u. thanks

May 10 '06 #13

P: n/a
"stam" <st******@gmail.com> wrote:

i'm still testing the function, so it still didn't publicly. or u just
give me ur email address so i just send it to u. thanks


Ummm, my e-mail address is in the signature of every post I make...
--
- Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
May 11 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.