help on "Array to string conversion" warning when use mail()
| From: | cchereTieShou | Date: | Tue, 05 Apr 2005 18:39:11 +0000 |
| Subject: | help on "Array to string conversion" warning when use mail() | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-212285@lists.php.net to get a copy of this message | ||
I am using the mail() function to send a quite simple email but always
get warning message as "Notice: Array to string conversion" at this
line "if(mail($MailTo, $MailSubj, $MailCon,
$MailH,"-fbounce@myhost.com")){" in the following php code.
I don't see where is the Array at all. Appreciated for helps
<?php
error_reporting(E_ALL);
$FromName="tieshou";
$MailFrom="xxxxx@xxxxxxxxx.com";
$MailTo="XXXX@yahoo.com";
$MailSubj="This is just a test for sending out email purpose";
$MailCon="This is a somehting to test out";
$MailH = "MIME-Version: 1.0\r\n";
$MailH .= "From: $FromName <$MailFrom>\r\n";
$MailH .= "Reply-to: $FromName <$MailFrom>\r\n";
$MailH .= "X-Priority: 3\r\n";
$MailH .= "X-Mailer: PHP mailer\r\n";
if(mail($MailTo, $MailSubj, $MailCon, $MailH, "-fbounce@myhost.com")){
echo "sending out succeessfully";
}else{
echo "Can't send out for some reason.";
}
?>