Bugs with php mail()

Hi,

Can anyone tell what I have done wrong with mail(); it won’t send any mails at all… :frowning:

if(!empty($mai_content))
		{
		$to_email = 'me1@yahoo.co.uk';
		$from_name = 'sender';
		$from_email =  'sender@yahoo.co.uk';
		$subject = "You have a comment!";
		$headers  = "MIME-Version: 1.0\\r\
";
		$headers .= "Content-type: text/plain; charset=utf-8\\r\
";	
		$headers .= "From: $from_name <$from_email>\\r\
";
		$headers .= "Cc: me2@yahoo.co.uk\\r\
";
		$headers .= 'Bcc: me3@lauthiamkok.net, me4@lauthiamkok.net';
		$content = stripslashes($row_mailing_tmp['mai_content']);
		$sentmail = mail($to_email,$subject,$content,$headers);
		}

I have spent my entire evening but still cannot find out what is wrong with it.

Many thanks,
Lau

Have you checked the mail log? If mail() is returning true, then it’s probably the mail server not sending the mail, not PHP.

hi thanks, could u tell me how to check mail log please…?

Depends what MTA you have installed on the server, but most logs are somewhere under /var/log.

thanks. i think there is something wrong with the mail server over there as I have tried as simple as this one but it still won’t work! :headbang:

mail(‘me1@yahoo.co.uk’,‘subject’,‘message’);

Is this code verbatim as you are using it (except for email addresses of course)? I notice some inconsistency, first you check for $mai_content but then you use $row_mailing_tmp[‘mai_content’] …