Re: why does a html mail send as text ?
| From: | Bastien Koert | Date: | Wed, 04 Feb 2009 14:58:43 +0000 |
| Subject: | Re: why does a html mail send as text ? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-287610@lists.php.net to get a copy of this message | ||
2009/2/4 Bulend Kolay <bmalik@ihlas.net.tr>
> I attached my code
> Thanks
>
>
>
>
> Show your code, but it sounds like maybe the HTML flag is not set.
>> Consider using a class like phpmailer or the mime mail class from
>> phpclasses.org
>>
>> Bastien
>>
>> Sent from my iPod
>>
>> On Feb 4, 2009, at 6:28, "Bulend Kolay" <bmalik@ihlas.net.tr> wrote:
>>
>> I use php-5.2.6 and apache2.2.x on opensuse11
>>>
>>> I have a file called mailsend.php to send a mail of html format.
>>> the server sends the mail form of html format. But I get it as text
>>> instead of html.
>>> default_mimetype is set as text/html in php.ini file.
>>>
>>> How can I correct this ?
>>>
>>>
>>>
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
Looking the code quickly, the only thing I do differently is setting the
headers:
//build the headers
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "X-Mailer: PHP\n";
$headers .= "From: \"Site Admin <no-reply@sitename.com>\n";
What mail client are you using? Does it / is it set to accept html mails?
--
Bastien
Cat, the other other white meat