PHP Confirmation email Help
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: PHP Confirmation email Help

  1. #1
    JAyzEE
    Join Date
    Apr 2002
    Location
    Karachi , Pakistan
    Posts
    601

    Exclamation PHP Confirmation email Help

    i am using the following form for getting customer feedback. My form is working perfectly but my customers are not getting confirmation emails if they enter their hotmail or yahoo id's (tested with yahoo and Hotmail but did not received confirmation email on submission of form) however the script is working with gmail.

    HTML Code
    Code:
    <form action="mail.php" method="POST">
    Name</br> <input type="text" name="name" class="text"></br>
    Email</br> <input type="text" name="email" class="text"></br>
    Phone</br> <input type="text" name="phone" class="text"></br>
    
    Gender : Male <input type="checkbox" value="Male" name="call"> Female <input type="checkbox" value="Female" name="call"><br />
    
    City</br><input type="text" name="website" class="text">
    </br>
    I have completed my:</br>
    <select name="priority" size="1">
    <option value="Matric">Matric</option>
    <option value="o/A Levels">o/A Levels</option>
    <option value="BCOM/HND/BBA">BCOM/HND/BBA</option>
    <option value="others">others</option>
    </select>
    </br>
    
    
    I want to Apply for:</br>
    <select name="type" size="1">
    <option value="HDA">HDA</option>
    <option value="BA (hons) Business Studies">BA (hons) Business Studies</option>
    <option value="BSc (hons) Compyter Studies">BSc (hons) Compyter Studies</option>
    <option value="MBA">MBA Shipping & Logistics</option>
    </select>
    <br />
    
    Remarks (if any)</br><textarea name="message" rows="6" cols="25"></textarea><br />
    <input type="submit" value="Send"><input type="reset" value="Clear">
    </form>

    PHP Code
    Code:
    <?php
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $call = $_POST['call'];
    $website = $_POST['website'];
    $priority = $_POST['priority'];
    $type = $_POST['type'];
    $message = $_POST['message'];
    
    $subject = "MIMS Online Registration - Thank you for your e-mail!";
    $body = "Dear $name\n\n Thank You!\n\n We have received your response.\n Please give us 24 Hours to respond.\n\nRegards\nMIMS Admin Team";
    $headers = "From: $email";
    mail($email, $subject, $body, $headers);
    
    $formcontent=" From: $name \n Phone: $phone \n Gender: $call \n City: $website \n Applicant has completed : $priority \n Wants to Apply for: $type \n Message: $message";
    $recipient = "xyz@gmail.com";
    $subject = "Contact Form";
    $mailheader = "From: $email \r\n";
    mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
    header( "Location: tu.html" );
    ?>
    Need help
    Junaid Zamir

  2. #2
    Moderator
    Join Date
    Feb 2001
    Posts
    13,044
    Hi,

    you are using "From $email" as header when sending to the person. So in practice this would mean that somebody with an address
    like me@hotmail.com would eventually receive a message that can be traced to your server but says "Frem: me@hotmail.com"

    There are a few systems around that try to limit fake emails. The sending domain (would be hotmail here) declares that all mails from hotmail members is sent through a given list of mailservers, and every recipient is free to view such lists and throw mail into the junk folder.

    So I would suggest to change the mail to person "From" to webserver@yourdomain.com, noreply@yourdomain.com, or a valid contact,

    Another point worth looking: the mails that are actually delivered may or may not have a valid To header. If they do not, add "To: $email"
    to the headers.
    I have set up my personal inbox so that anything without me appearing in To or Cc (and not on a whitelist) gets delivered with a big "SUSPICIOUS" added to the subject....

    Musicman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com