Send email via PHP function not working -
i'm having problems php mail function in php application. below code reason not work. i've spent last hour trying figure out why won't send email. please point me in right direction? 100% sure has nothing post variables form or query. thank much!
<?php include 'inc/db.php'; $sellerid = $_post['sellerid']; $subject = $_post['subject']; $message = $_post['message']; $query = "select * users id='$sellerid'"; $result = $mainframeconnection->query($query); if (!$result) { die("error!"); } while ($field = $result->fetch_array()) { $to = $field['email']; } $headers = 'from: test@test.com' . "\r\n" . 'reply-to: test@test.com' . "\r\n" . 'x-mailer: php/' . phpversion(); mail($to, $subject, $message, $headers); header('location: message-sent.php'); ?>
Comments
Post a Comment