0

php sending mail problem,processing this code display msg success but i can't get any mail in my mail id.

<form action="mail.php" method="post"> <div class="form-group"> <input type="text" class="form-control" placeholder="Your Name" name="name" id="name" required> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Company Name" name="cname" id="cname" required> </div> <div class="form-group"> <input type="email" class="form-control" placeholder="email" name="email" id="email" required> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Phone No" name="phone" id="phone" required> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Address" name="address" id="address" required> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="subject" name="subject" id="subject" required> </div> <div class="form-group"> <input type="textarea" class="form-control" name="message" id="message" placeholder="Requirements & Description" name="subject" id="subject" required> </div> <div class="form-group text-right"> <button class="btn btn-rounded btn-primary">send message</button> </div> </form>

23rd Jul 2019, 6:25 AM
SOUVIK RAY BARMAN
SOUVIK RAY BARMAN - avatar
1 Odpowiedź
0
//this is mail.php file <?php $to = 'souvik.barman@elrising.com'; $firstname = $_POST["name"]; $Cname = $_POST["cname"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $address = $_POST["address"]; $message = $_POST["message"]; $textp = $_POST["subject"]; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= "From: " . $email . "\r\n"; // Sender's E-mail $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $message ='<table style="width:100%"> <tr> <td>'.$firstname.'</td> </tr> <tr><td>Company Name: '.$Cname.'</td></tr> <tr><td>Email: '.$email.'</td></tr> <tr><td>phone: '.$phone.'</td></tr> <tr><td>Adress: '.$address.'</td></tr> <tr><td>Text: '.$textp.'</td></tr> <tr><td>Message: '.$message.'</td></tr> </table>'; if (@mail($to, $email, $message, $headers)) { echo 'The message has been sent.'; }else{ echo 'failed'; } ?>
23rd Jul 2019, 6:31 AM
SOUVIK RAY BARMAN
SOUVIK RAY BARMAN - avatar