php mail function from email address shows mail server address

Krishna Pariyar

Following are my code to send reservation from a form. Everything is sent as per the form but the in my inbox FROM section it shows mail server address instead of showing senders email address.

<?php 
  if(isset($_POST['rsubmit'])){ 
      //echo "samir karmachary"; 
      $fname=$_POST['fname']; 
      $remail=$_POST['remail']; 
      $rphone=$_POST['rphone']; 
      $pick_up_date=$_POST['pick_up_date']; 
      $pick_up_time=$_POST['pick_hour'].":".$_POST['pick_min']."".$_POST['pick_ampm']; 
      $taxitype=$_POST['taxitype']; 
      $ploc=$_POST['ploc']; 
      $dloc=$_POST['dloc']; 
      $passangerno=$_POST['passangerno']; 
      $luggageno=$_POST['luggageno']; 
      $comment=$_POST['comment']; 
      $payment_type=$_POST['payment_type']; 
      $to='[email protected]'; 
      // subject 
      $subject = 'Reservation detail convenience'; 
      // message 
      $message = ' <html> <head> <title>Reservation Detail Convenience</title> </head>     <body> <table width=100% cellpadding="4" cellspacing="4"> <tr><td width="30%" >Name :</td><td>'.$fname.'</td></tr> <tr><td>Email :</td><td>'.$remail.'</td></tr> <tr> <td>Phone :</td><td>'.$rphone.'</td></tr> <tr><td>Pick up Date:</td><td>'.$pick_up_date.'</td></tr> <tr><td>Pick up Time:</td><td>'.$pick_up_time.'</td></tr> <tr><td>Taxi Type:</td><td>'.$taxitype.'</td></tr> <tr><td>Pick Up location:</td><td>'.$ploc.'</td></tr> <tr><td>Drop Of Location:</td><td>'.$dloc.'</td></tr> <tr><td>Passanger No:</td><td>'.$passangerno.'</td></tr> <tr><td>Luggage No:</td><td>'.$luggageno.'</td></tr> <tr><td>Comment:</td><td>'.$comment.'</td></tr> <tr><td>Payment:</td><td>'.$payment_type.'</td></tr> </table> </body> </html> '; 
      // To send HTML mail, the Content-type header must be set 
      $headers = 'MIME-Version: 1.0' . "\r\n"; 
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
      // Additional headers 
      $headers .= 'From: Convernience<Convernience>' . "\r\n"; 
      if(mail($to, $subject, $message, $headers)){ 
          $to=$remail; mail($to, $subject, $message, $headers); 
          echo "<script type='text/javascript'>alert('Reservation successfully');</script>"; 
      }else{ 
          echo "<script type='text/javascript'>alert('Sorry please try again');</script>"; 
      } 
  }
?>
N.DeNisse

This is normal. It really depends on the web server where you are hosting and the email service you are using. Research your hosting where you use the mail function. Most likely this happens because you pretend to send the message from person who fills up the form on your website and the mail server detects it as fraudulent... my guess... when I had the same problem and did some poking around.

Hope this was helpful.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Send mail to an email address using Yesod

From Dev

Is there a way to prevent mail clients from caching an email address?

From Dev

Pony.mail() Email is being sent by and to the same email address

From Dev

php mail function failed to send html email to hotmail and aol address

From Dev

PHP mail is not sending email to my email address

From Dev

My php() mail script wont send emails if the from address is from a yahoo email address

From Dev

PHPMailer for SMTP sends mail to inbox but from invalid mail address

From Dev

Send mail using the email address from a variable

From Dev

Get 'default' FROM address if no FROM address is given .NET.Mail

From Dev

How to get php mail() to send user uploaded image to my email address

From Dev

PHP 'mail()' Function Not Sending Email

From Dev

Pass email address to Mail::send function Laravel

From Dev

What info can I get about mail server from email address?

From Dev

Is there a way to prevent mail clients from caching an email address?

From Dev

Send mail to an email address using Yesod

From Dev

PHP mail is not sending email to my email address

From Dev

PHP - Sending email from form with mail function

From Dev

Is there a way to change from address/email id on email sent from Google App engine Mail

From Dev

Send HTML Email from PHP Mail function

From Dev

Email address validation Vs sending mail for activation?

From Dev

Spam from your e-mail address

From Dev

Mail-inbox shows a mail sent from its own mail-address without having sent it

From Dev

Using aliased email address to send mail from Google App Engine

From Dev

PHP Send mail function. How to make one email address receive one email containing data based on the number of ticked checkbox in a table

From Dev

Extract e-mail address from string

From Dev

Server mail BCC to address@servername

From Dev

Is it possible to change the “From:” address of a distribution list to to the distribution list e-mail address and not the sender’s email address?

From Dev

java mail - use dynamic sender email address

From Dev

PHP Mail not sending from "FROM Address"

Related Related

  1. 1

    Send mail to an email address using Yesod

  2. 2

    Is there a way to prevent mail clients from caching an email address?

  3. 3

    Pony.mail() Email is being sent by and to the same email address

  4. 4

    php mail function failed to send html email to hotmail and aol address

  5. 5

    PHP mail is not sending email to my email address

  6. 6

    My php() mail script wont send emails if the from address is from a yahoo email address

  7. 7

    PHPMailer for SMTP sends mail to inbox but from invalid mail address

  8. 8

    Send mail using the email address from a variable

  9. 9

    Get 'default' FROM address if no FROM address is given .NET.Mail

  10. 10

    How to get php mail() to send user uploaded image to my email address

  11. 11

    PHP 'mail()' Function Not Sending Email

  12. 12

    Pass email address to Mail::send function Laravel

  13. 13

    What info can I get about mail server from email address?

  14. 14

    Is there a way to prevent mail clients from caching an email address?

  15. 15

    Send mail to an email address using Yesod

  16. 16

    PHP mail is not sending email to my email address

  17. 17

    PHP - Sending email from form with mail function

  18. 18

    Is there a way to change from address/email id on email sent from Google App engine Mail

  19. 19

    Send HTML Email from PHP Mail function

  20. 20

    Email address validation Vs sending mail for activation?

  21. 21

    Spam from your e-mail address

  22. 22

    Mail-inbox shows a mail sent from its own mail-address without having sent it

  23. 23

    Using aliased email address to send mail from Google App Engine

  24. 24

    PHP Send mail function. How to make one email address receive one email containing data based on the number of ticked checkbox in a table

  25. 25

    Extract e-mail address from string

  26. 26

    Server mail BCC to address@servername

  27. 27

    Is it possible to change the “From:” address of a distribution list to to the distribution list e-mail address and not the sender’s email address?

  28. 28

    java mail - use dynamic sender email address

  29. 29

    PHP Mail not sending from "FROM Address"

HotTag

Archive