danzora Posted February 29, 2016 Share Posted February 29, 2016 Hello I tried sending a mail using the php mail function but the mail is not sending. <?php $to = $_REQUEST['to']; $subject = $_REQUEST['subject']; $body = $_REQUEST['body']; $headers = 'From: daniel@zoracom.com' . "\r\n" . 'Reply-To: daniel@zoracom.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $body, $headers); ?> <script type="text/javascript"> alert('Mail Sent!'); window.location.href='dashboard.php'; </script> <?php ?> Quote Link to comment https://forums.phpfreaks.com/topic/300909-php-mail-function-not-working/ Share on other sites More sharing options...
requinix Posted February 29, 2016 Share Posted February 29, 2016 Is mail() returning true or false? Have you checked your spam/junk folders? Try using a library like PHPMailer to send emails instead. It is much more sophisticated than simply calling mail() and with it your emails have a higher likelihood of not being detected as spam anyways. Quote Link to comment https://forums.phpfreaks.com/topic/300909-php-mail-function-not-working/#findComment-1531583 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.