argan328 Posted March 24, 2007 Share Posted March 24, 2007 Can someone tell me why I'm getting the following error? Warning: mail() expects parameter 3 to be string, array given in /home/content/x/x/x/xxxxxxx/html/guestbook/sign.php on line 314 here is the code: $to="[email protected]"; $subject="Someone has signed the guestbook!!"; $body="Hey, go take a look at the site because someone's left a guestbook entry!"; $headers="From: [email protected]"; mail($to, $subject, $body, $headers); //this is line 314 Link to comment https://forums.phpfreaks.com/topic/44073-solved-why-mail-error/ Share on other sites More sharing options...
JasonLewis Posted March 24, 2007 Share Posted March 24, 2007 can you echo out the $body and see if you get what you wrote? it would be weird if you got this: Array Link to comment https://forums.phpfreaks.com/topic/44073-solved-why-mail-error/#findComment-214021 Share on other sites More sharing options...
argan328 Posted March 24, 2007 Author Share Posted March 24, 2007 the truth is I've been playing with it for a few hours now and shortly after I posted this question it stopped giving me the error. I still have the same $body="Hey, go take a look at the site because someone's left a guestbook entry!"; which is really weird but I did change a bunch of other stuff so I'm wondering if the problem wasn't really with that line of code. although I'd like to know what was wrong the good news is it's solved (somehow!) Thanks! Argan Link to comment https://forums.phpfreaks.com/topic/44073-solved-why-mail-error/#findComment-214025 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.