Forum Moderators: coopster
<table width="100%" color="Red">
mail() converting " to &qoute ,thats why its showing table color black plus not 100% width
what should i do to send exact html code? because I can`t bind admin to send html without double qoutes that is "
thankyou
mail('af@localhost', 'subject',
'<script type="text/javascript">alert()</script>'); worked just fine. Make sure that the message does not contain the entities when you pass it to mail().
Andreas
Return-Path: <apache@domain.de>
Received: (from apache@localhost)
by domain.de (8.11.6/8.11.0) id h0HCrDZ02214;
Fri, 17 Jan 2003 13:53:13 +0100
Date: Fri, 17 Jan 2003 13:53:13 +0100
From: Apache <apache@domain.de>
Message-Id: <200301171253.h0HCrDZ02214@domain.de>
To: af@domain.de
Subject: subject
Content-type: text/html; charset=iso-8859-1
.
.
<script type="text/javascript">alert()</script>
Are you sure that mail is working fine without the content-type header field and just converts quotes to entities when you use the extra header field?
If that were the case then I´d consider that a bug in the mail() function. There is absolutely nothing in the documentation that would suggest such a conversion. mail() does not scan the additional_headers to find out the specified content type nor does it convert the message to be of the appropriate type.
Andreas
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
/* additional headers */
$headers .= "From: ADmin <admin@site.com>\r\n";
//$message=htmlentities($message,ENT_NOQUOTES);
/* and now mail it */
mail($to, $subject, $message, $headers)or die ("coudn`t send mail");
magic_quotes_gpc [php.net] sets whether Get/Post/Cookie operations are automatically quoted. magic_quotes_runtime [php.net] does the same for operations that return data from any sort of external source.
Both do not apply in this case. They are about quoting certain characters. They never cause PHP to convert quotes to entities.
Andreas