SitePoint Sponsor

User Tag List

Results 1 to 21 of 21

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sendmail form not working properly..probably something simple

    Can anyone help me rectify this sendmail.php form..?

    In the sendmail.php file (attached), I need to change the form id 'website' to 'pickup-addr' but everytime I try it stops the emails from going/coming altogether.


    When I leave 'website' in the sendmail.php file, it goes but this is what shows up in the body of the email:

    This message was send from:

    by: Janessa Mc Kell

    Email: janessa.mckell@gmail.com

    Pickup Details:

    Subject: airport run

    Text of message: 1 person with 4 pcs luggage

    sendmail_php.zip

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    88
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sorry - but I don't normally download somebody's zip file (or full scripts for that matter). A bit of paranoia.

    Of course, you could make it easier for us to help if you JUST posted the area of code that is causing your problem

  3. #3
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ginerjm View Post
    Sorry - but I don't normally download somebody's zip file (or full scripts for that matter). A bit of paranoia.

    Of course, you could make it easier for us to help if you JUST posted the area of code that is causing your problem
    Hi ginerjm, no problem, here is the code for the two files:

    ...contacts.html

    Code:
    <div class="main">
      <div class="row-nav">
        <nav id="navigation">
          <ul style="text-align:center">
            <li><a href="home.html">about us</a></li>
            <li><a href="services.html">services</a></li>
            <li class="active"><a href="contacts.html">contact us</a></li>
          </ul>
        </nav>
        <div class="clear"></div>
        <!--/ navigation--> 
      </div>
      <section  id="content"  class="clearfix">
        <div class="box-map">
          <h2>Our Location</h2>
          
          <div class="overflow">
            <address>
            <span><strong>Call Ron Lewis at:1-868-342-6103</strong></span>
            <strong>Email:</strong><a href="mailto:wellgetuthere@gmail.com"> wellgetuthere@gmail.com</a></span>
            </address>
          </div>
        </div>
        <div class="box-form">
          <h2>Contact Form</h2>
          <div class="box error_box" style="display:none;">
            <p> Your message has not been sent successfully. There was an error on the page! </p>
          </div>
          <div class="box info_box" style="display:none;">
            <p> Thank you! Your message has been sent successfully. </p>
          </div>
          <form action="#" method="post" id="contactform">
            <fieldset>
              <div class="box-left1">
                <input type="text" name="name" id="name" placeholder="Your Name (required)" />
                <input type="text" name="email" id="email" placeholder="Your E-mail (required)" />
                <p><strong>Do you need to book us? Please give details. <br />(NB: 50% downpayment required on all drops)</strong></p>
                <input type="text" name="pickup-addr" id="pickup-addr" placeholder="Pickup Address" />
                <input type="text" name="date" id="date" placeholder="Enter Date and Time of Pickup" />
              </div>
              <div class="box-right1">
                <input type="text" name="subject" id="subject" placeholder="Subject" />
                <textarea name="message" id="message" placeholder="Send more details if you're booking us or if not, you may also send a messsage here."></textarea>
                <input id="formsend" type="submit" value="send" />
                <input type="reset" value="Clear" />
              </div>
              <div class="clear"></div>
            </fieldset>
            <fieldset>
              <div>
                <input type="hidden" value="janessa.mckell@gmail.com" id="contactemail" name="contactemail"  />
              </div>
              <div>
                <input type="hidden" value="php/sendmail.php" id="contacturl" name="contacturl"  />
              </div>
              <div class="loading"></div>
            </fieldset>
          </form>
        </div>
        <!--/ contform--> 
        
      </section>
    </div>

    ...and sendmail.php:

    Code:
    <?php
    if (isset($_REQUEST['type']) && $_REQUEST['type'] == 'form'){
    	if (isset($_REQUEST['contactemail'])){ $mailTo = $_REQUEST['contactemail']; }
    	if (isset($_REQUEST['name'])){ $mailFromName = $_REQUEST['name']; }
    	if (isset($_REQUEST['email'])){ $mailFromEmail = $_REQUEST['email']; }
    	if (isset($_REQUEST['pickup-addr'])){ $website = $_REQUEST['pickup-addr']; }
    	if (isset($_REQUEST['date'])){ $website = $_REQUEST['date']; }
    	if (isset($_REQUEST['subject'])){ $subject = $_REQUEST['subject']; }
    	if (isset($_REQUEST['message'])){ $message = $_REQUEST['message']; }
    	if (isset($_REQUEST['mywebsite'])){ $mailFromWebsite = $_REQUEST['mywebsite']; }
    	
    	$msg = "This message was sent from: $mailFromWebsite \n\nby: $mailFromName \n\nEmail: $mailFromEmail \n\nPickup Details: $website \n\nSubject: $subject \n\nText of message: $message";
    	$headers = "MIME-Version: 1.0\r\n Content-type: text/html; charset=utf-8\r\n From: $mailFromEmail\r\n Reply-To: $mailFromEmail";
    	
    	mail($mailTo, $subject, $msg, $headers);
    }
    ?>

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    88
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Show us the exact area that has the problem and tell us exactly what you are changing. I see no exact word 'website' in your script nor any reference in the code to a "form id". Hard to help if you don't show us the change you are making. Sorry to be such a pia, but you are not really making much sense.

  5. #5
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ginerjm View Post
    Show us the exact area that has the problem and tell us exactly what you are changing. I see no exact word 'website' in your script nor any reference in the code to a "form id". Hard to help if you don't show us the change you are making. Sorry to be such a pia, but you are not really making much sense.
    Hey ginerjm, it's okay, let me see if I can explain better...

    In the sendmail.php file, this bit of code:
    Code:
    	if (isset($_REQUEST['contactemail'])){ $mailTo = $_REQUEST['contactemail']; }
    	if (isset($_REQUEST['name'])){ $mailFromName = $_REQUEST['name']; }
    	if (isset($_REQUEST['email'])){ $mailFromEmail = $_REQUEST['email']; }
    	if (isset($_REQUEST['pickup-addr'])){ $website = $_REQUEST['pickup-addr']; }
    	if (isset($_REQUEST['date'])){ $website = $_REQUEST['date']; }
    	if (isset($_REQUEST['subject'])){ $subject = $_REQUEST['subject']; }
    	if (isset($_REQUEST['message'])){ $message = $_REQUEST['message']; }
    	if (isset($_REQUEST['mywebsite'])){ $mailFromWebsite = $_REQUEST['mywebsite']; }
    corresponds to the output (the email that is sent when the form is filled out)...

    This message was send from:

    by: Janessa Mc Kell

    Email: janessa.mckell@gmail.com

    Pickup Details:

    Subject: airport run

    Text of message: 1 person with 4 pcs luggage

    ----

    You'd notice that 'Pickup Details' is blank but I have tried assigning that field's id (pickup-addr) to be displayed after the words 'Pickup Details'...but it's not responding that way...The code that is controlling the Display (when the form is emailed):

    Code:
    $msg = "This message was sent from: $mailFromWebsite \n\nby: $mailFromName \n\nEmail: $mailFromEmail \n\nPickup Details: $website \n\nSubject: $subject \n\nText of message: $message";
    	$headers = "MIME-Version: 1.0\r\n Content-type: text/html; charset=utf-8\r\n From: $mailFromEmail\r\n Reply-To: $mailFromEmail";
    It's just leaving it out altogether, even when I change 'website' as the field id to 'pickup-addr' - see these two lines:

    Code:
    	if (isset($_REQUEST['pickup-addr'])){ $website = $_REQUEST['pickup-addr']; }
    	if (isset($_REQUEST['date'])){ $website = $_REQUEST['date']; }
    I really hope this explanation is better...

  6. #6
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    88
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This message was send from:

    by: Janessa Mc Kell

    Email: janessa.mckell@gmail.com

    Pickup Details:

    Subject: airport run

    Text of message: 1 person with 4 pcs luggage

    ----

    You'd notice that 'Pickup Details' is blank but I have tried assigning that field's id (pickup-addr) to be displayed after the words 'Pickup Details'...but it's not responding that way...The code that is controlling the Display (when the form is emailed):
    Code:
    $msg = "This message was sent from: $mailFromWebsite \n\nby: $mailFromName \n\nEmail: $mailFromEmail \n\nPickup Details: $website \n\nSubject: $subject \n\nText of message: $message";
    	$headers = "MIME-Version: 1.0\r\n Content-type: text/html; charset=utf-8\r\n From: $mailFromEmail\r\n Reply-To: $mailFromEmail";
    It's just leaving it out altogether, even when I change 'website' as the field id to 'pickup-addr' - see these two lines:
    Code:
    	if (isset($_REQUEST['pickup-addr'])){ $website = $_REQUEST['pickup-addr']; }
    	if (isset($_REQUEST['date'])){ $website = $_REQUEST['date']; }
    Your supposed "output" display was NOT generated by the code you have provided. Makes me wonder what code you are running.
    Also - what is this "field id" you are referring to? Also - you apparently are NOT entering any data into the 'date' field since your pickup addr should be showing a date value since that is where you are stashing the date value. Huge typo.

  7. #7
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    88
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    See where you are storing the date input.

  8. #8
    SitePoint Member
    Join Date
    Mar 2007
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What's that ginerjm?

  9. #9
    SitePoint Enthusiast
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    88
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Look at your code! Where are you storing the date value from your post array?


Bookmarks

Posting Permissions

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