gergy008 Posted May 26, 2010 Share Posted May 26, 2010 I get this error on sending an automatically generated email... Content-type:... List:; syntax illegal for recipient addresses /home/sites/#####.co.uk/dead.letter... Saved message in /home/sites/#####.co.uk/dead.letter #'d out my domain My headers are as follows: $topic="Welcome!"; $detail="message"; $recipent=$_POST["login"]; $run=mail($recipent, $topic, $detail, "From: <support@#####.co.uk> #####.co.uk", "Content-type: text/html"); Can anyone please please help me out? Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/202996-emailing-error-unusual/ Share on other sites More sharing options...
The Eagle Posted May 26, 2010 Share Posted May 26, 2010 Shouldn't $topic be at least $subject? Do not know what $detail is, will presume a message. mail( "email", "$topic", $message, "From: $email" ); Link to comment https://forums.phpfreaks.com/topic/202996-emailing-error-unusual/#findComment-1063743 Share on other sites More sharing options...
iJoseph Posted May 26, 2010 Share Posted May 26, 2010 I normally do: <?php $from = "From: <[email protected]> "; $to = " [email protected] "; $subject = "Subject"; $message="Hello!"; $message = stripslashes($message); if (mail($to,$subject,$message,$from)) { echo "Message sent"; } else { echo "MAIL FAILED"; } ?> Link to comment https://forums.phpfreaks.com/topic/202996-emailing-error-unusual/#findComment-1063748 Share on other sites More sharing options...
gergy008 Posted May 26, 2010 Author Share Posted May 26, 2010 Shouldn't $topic be at least $subject? Do not know what $detail is, will presume a message. mail( "email", "$topic", $message, "From: $email" ); Yes you are right on both, Sorry for that, Detail is the message and topic is subject. I think it's because I am sending a HTML email to a hotmail address, For some reason that message comes up... Link to comment https://forums.phpfreaks.com/topic/202996-emailing-error-unusual/#findComment-1063781 Share on other sites More sharing options...
mattal999 Posted May 26, 2010 Share Posted May 26, 2010 Echo out the $_POST['login'] to see what is output. If it is not an email address like you expected (which is what I'm guessing is the problem), then you have identified the mistake. Link to comment https://forums.phpfreaks.com/topic/202996-emailing-error-unusual/#findComment-1063783 Share on other sites More sharing options...
gergy008 Posted May 26, 2010 Author Share Posted May 26, 2010 Echo out the $_POST['login'] to see what is output. If it is not an email address like you expected (which is what I'm guessing is the problem), then you have identified the mistake. Another one of my silly mistakes, Sorry about all this guys, SOLVED Link to comment https://forums.phpfreaks.com/topic/202996-emailing-error-unusual/#findComment-1063785 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.