[最佳答案] If you check your code // Make sure to escape quotes $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Homeless' . "\r\n"; mail($to, $subject, $msg, $headers); date_default_timezone_set('America/Los_Angeles'); This code is already sending the mail regard less of the result. You just need to remove this line from top code mail($to, $subject, $msg, $headers); and your code will work fine.