Jump to content

Simple email issue


fwof1976

Recommended Posts

I have had this code working before, then as I built the rest of the site, it stopped working.  I have tried other code, and just cannot get it to send an email.  It will transition to the PHP page and give the auto response I want, but doesnt transfer any of the data.  Any help would be awesome!

 

PHP CODE

<?php
$to = "fishwithoutfeet@gmail.com";
$subject = "Website Message";

$message = "Confidential     " . $_POST['confidential_0'] . "\r\n" . "\r\n" .
"Prayer Request " . $_POST['info_0'] . "\r\n" . 
"Message for Pastor Tim: " . $_POST['info_1'] . "\r\n" .
"Message for Pastor Caleb: " . $_POST['info_2'] . "\r\n" .
"Message for Pastor Andrew: " . $_POST['info_3'] . "\r\n" . 
"Message for Pastor Steven: " . $_POST['info_4'] . "\r\n" .
"Message for Tonya: " . $_POST['info_5'] . "\r\n" .
"Other: " . $_POST['info_6'] . "\r\n" .
"Name: " . $_POST['name'] . "\r\n" .
"Email: " . $_POST['email'] . "\r\n" .
"Phone Number: " . $_POST['phone'] . "\r\n" . "\r\n" .
"Reason for Contact: " . $_POST['content'];
$_POST['contact']; $from = $_POST['email'];
$headers = "Bcc: fishwithoutfeet@gmail.com" . "\r\n";
mail($to,$subject,$message);
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bluffton Nazarene Church</title>
<link href="McConnehey_Final2.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#apDiv1 {
	position:absolute;
	width:200px;
	height:115px;
	z-index:1;
	margin-left: auto;
	left: 33%;
}
</style> 
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
</head>

<body>


<div id="wrapper">
<div id="apDiv1"><img src="images/logo.png" width="491" height="265" alt="Bluffton Nazarene Church Logo" /></div>
<div id="header">
</div>
<div class="sidebar">
  <ul id="MenuBar1" class="MenuBarVertical">
  <li><a href="index2.html">Home</a></li>
    <li><a class="MenuBarItemSubmenu" href="#">Want to Know Jesus?</a>
      <ul>
        <li><a href="recjesus.html">Receiving Jesus</a></li>
        <li><a href="whatnow.html">What Now?</a></li>
        <li><a href="jesusvid.html">Jesus Video</a></li>
      </ul>
    </li>
    <li><a href="aboutus.html">About Us</a></li>
    <li><a class="MenuBarItemSubmenu" href="#">Our Staff</a>
      <ul>
        <li><a href="tmiller.html">Lead Pastor Tim Miller</a>          </li>
        <li><a href="creynolds.html">Pastor of Worship & Visitation Caleb Reynolds</a></li>
        <li><a href="amiller.html">Pastor of Youth and Senior Adults Andrew Miller</a></li>
      </ul>
    </li>
    <li><a href="#" class="MenuBarItemSubmenu">Ministries</a>
      <ul>
        <li><a href="children.html">Children</a></li>
        <li><a href="teens.html">Teens</a></li>
        <li><a href="adults.html">Adults</a></li>
        <li><a href="senioradults.html">Senior Adults</a></li>
      </ul>
    </li>
    <li><a href="#" class="MenuBarItemSubmenu">Resources</a>
      <ul>
        <li><a href="sermons.html">Sermons</a></li>
        <li><a href="booksandsites.html">Books and Websites</a></li>
        <li><a href="assistance.html">Assistance</a></li>
      </ul>
    </li>
    <li><a href="contactus.html">Contact Us</a></li>
  </ul>
  <p> </p>
  <p> </p>
  <div class="calendar">
  <script>
  // Other settings you can customize for your site
  var lcPopupColor="rgba(230, 230, 230, .9)"; /* Try other values like: rgb(230,230,230), #b0c4de, yellow, etc */
  var lcPopupOutline="#333333";
  var lcPopupCornerRadius=20; /* Set to 0 for square corners */
</script>
<script type="text/javascript" src='http://www.localendar.com/js/PublishedIncludeMini.js'></script>

<!-- Place this line where you would like the calendar to appear (in a <div>, table, etc) -->
<script type="text/javascript" src='http://www.localendar.com/public/bln1or5?include=Y&style=M5'></script>
</div>
<div class="info">
<p><span class="headlineSM">Office Hours:</span><br />
  Mon - Fri 8:30-4:30   260.824.0460
 </p>
<p> <span class="headlineSM">Sunday</span><br />
  Sunday School:  9:00-10:00am<br />
  Morning Worship:  10:15-11:30am<br />
  Evening Worship:  6:00-7:00pm
</p>
<p> </p>
<span class="headlineSM">Wednesday</span><br />
Teens:  6:30-8:00pm<br />
Children:  7:00-8:00pm<br />
Adult Bible Study:  7:00-8:00pm<br />
Dare 2 Care:  7:00-8:00pm
<p> </p>
<p class="headlineSM">Español</br>
<p>La Escuela del domingo: ESL 9:00-10:00am (segunda Lengua inglesa) : El Culto <br />
  de la Mañana 9:00-10:00am</p>
<p>(Tradujo de inglés a español) : 10:15-11:30am<br /> Culto Nocturno: 6:00-7:00pm</p>
<p>Los Jóvenes del miércoles: Los Niños 6:30-8:00pm: 7:00-8:00pm</p>
<p>Estudio <br />
  Adulto de Biblia: 7:00-8:00pm</p>
<p>e Atreve 2 Cuidado: 7:00-8:00pm</p>
</p>
</div>
</div>
<div class="content">

<h2>Thanks!</h2>
<p> </p>
<p> </p>
<p class="home"><a href="index2.html">RETURN HOME</a></p>
</div>
<div id="clrbox"></div>
<div id="footer">

<p><strong><a href="index2.html">Home</a></strong>  |  <strong><a href="recjesus.html">Want to Know Jesus?</a></strong>  | <strong><a href="aboutus.html">About Us</a></strong> | <strong><a href="contactus.html">Contact Us</a></strong></p>
<h3>©Copyright 2012 Bluffton Church of the Nazarene</h3>
Site Designed By <a href="http://www.fishwithoutfeet.com"><span class="biz">Fish Without Feet Graphic Design</span></a>
</div></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>

HTML PAGE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bluffton Nazarene Church</title>
<link href="McConnehey_Final2.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#apDiv1 {
	position:absolute;
	width:960px;
	height:115px;
	z-index:1;
	margin-left: auto;
	margin-right: auto;
}
</style> 
<script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script><script src="../SpryAssets/SpryValidationRadio.js" type="text/javascript"></script>
<script src="../SpryAssets/SpryValidationTextarea.js" type="text/javascript"></script>
<script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
<link href="../SpryAssets/SpryValidationRadio.css" rel="stylesheet" type="text/css" />
<link href="../SpryAssets/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
<link href="forms.css" rel="stylesheet" type="text/css" />
<link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="wrapper">
<div id="header">
<div id="apDiv1"><img src="images/logo.png" width="491" height="265" alt="Bluffton Nazarene Church Logo" /></div>
</div>
<div class="sidebar">
  <ul id="MenuBar1" class="MenuBarVertical">
  <li><a href="index2.html">Home</a></li>
    <li><a class="MenuBarItemSubmenu" href="#">Want to Know Jesus?</a>
      <ul>
        <li><a href="recjesus.html">Receiving Jesus</a></li>
        <li><a href="whatnow.html">What Now?</a></li>
        <li><a href="jesusvid.html">Jesus Video</a></li>
      </ul>
    </li>
    <li><a href="aboutus.html">About Us</a></li>
    <li><a class="MenuBarItemSubmenu" href="#">Our Staff</a>
      <ul>
        <li><a href="tmiller.html">Pastor Tim Miller</a></li>
        <li><a href="creynolds.html">Pastor Caleb Reynolds</a></li>
        <li><a href="amiller.html">Pastor Andrew Miller</a></li>
        <li><a href="sspencer.html">Pastor Steven Spencer</a></li>
      </ul>
    </li>
    <li><a href="#" class="MenuBarItemSubmenu">Ministries</a>
      <ul>
        <li><a href="children.html">Children</a></li>
        <li><a href="teens.html">Teens</a></li>
        <li><a href="adults.html">Adults</a></li>
        <li><a href="senioradults.html">Senior Adults</a></li>
      </ul>
    </li>
    <li><a href="#" class="MenuBarItemSubmenu">Resources</a>
      <ul>
        <li><a href="sermons.html">Sermons</a></li>
        <li><a href="booksandsites.html">Books and Websites</a></li>
        <li><a href="assistance.html">Assistance</a></li>
      </ul>
    </li>
    <li><a href="contactus.html">Contact Us</a></li>
  </ul>
  <p> </p>
  <p> </p>
  <div class="calendar">
  <script>
  // Other settings you can customize for your site
  var lcPopupColor="rgba(230, 230, 230, .9)"; /* Try other values like: rgb(230,230,230), #b0c4de, yellow, etc */
  var lcPopupOutline="#333333";
  var lcPopupCornerRadius=20; /* Set to 0 for square corners */
</script>
<script type="text/javascript" src='http://www.localendar.com/js/PublishedIncludeMini.js'></script>

<!-- Place this line where you would like the calendar to appear (in a <div>, table, etc) -->
<script type="text/javascript" src='http://www.localendar.com/public/bln1or5?include=Y&style=M5'></script>
</div>
<div class="info">
<p><span class="headlineSM">Office Hours:</span><br />
  Mon - Fri 8:30-4:30   260.824.0460
 </p>
<p> <span class="headlineSM">Sunday</span><br />
  Sunday School:  9:00-10:00am
  Morning Worship:  10:15-11:30am
  Evening Worship:  6:00-7:00pm
</p>
<p> </p>
<span class="headlineSM">Wednesday</span><br />
Teens:  6:30-8:00pm
Children:  7:00-8:00pm
Adult Bible Study:  7:00-8:00pm
Dare 2 Care:  7:00-8:00pm
<p> </p>
<p class="headlineSM">Español</br>
<p>La Escuela del domingo: ESL 9:00-10:00am (segunda Lengua inglesa) : El Culto <br />
  de la Mañana 9:00-10:00am</p>
<p>(Tradujo de inglés a español) : 10:15-11:30am Culto Nocturno: 6:00-7:00pm</p>
<p>Los Jóvenes del miércoles: Los Niños 6:30-8:00pm: 7:00-8:00pm</p>
<p>Estudio <br />
  Adulto de Biblia: 7:00-8:00pm</p>
<p>e Atreve 2 Cuidado: 7:00-8:00pm</p>
</p>
</div>
</div>
<div class="content">
<h1>Needing to Contact the Church?</h1>
<p>Help Us Meet Your Needs, please fill in all fields:</p>
<form id="contact" name="contact" method="post" action="email_form.php">
  <fieldset>
    <legend>Your Contact Information</legend>
    <p></p>
    <label for="name">Name:</label>
    <input type="text" name="name" id="name" />
    <br />
    <label for="phone">Phone:</label>
    <input type="text" name="phone" id="phone" />
    <br />
    <span id="email">
    <label for="email">Email:</label>
    <input type="text" name="email" id="email" />
    <span class="textfieldRequiredMsg">Required.</span><span class="textfieldInvalidFormatMsg">Invalid format.</span></span>
  </fieldset>
  <p> </p>
  <fieldset>
    <legend>How May We Serve You?</legend>
    <p>
    <p>Do You Wish This to be Confidential?<br />
    <span id="spryradio1">
      <label>
        <input type="radio" name="confidential_0" value="PRIVATE" id="confidential_0" />
        yes</label>
      <br />
      <label>
        <input type="radio" name="confidential_1" value="Public" id="confidential_1" />
        no</label>
      <br />
      <span class="radioRequiredMsg">Please make a selection.</span></span></p>
      <p> </p>
      <p>
        <label>
          <input type="checkbox" name="info_0" value="prayer" id="info_0" />
          Prayer Request</label>
        <br />
        <label>
          <input type="checkbox" name="info_1" value="AttnTimMiller" id="info_1" />
          Message for Pastor Tim Miller</label>
        <br />
        <label>
          <input type="checkbox" name="info_2" value="AttnCalebReynolds" id="info_2" />
          Message for Pastor Caleb Reynolds</label>
        <br />
        <label>
          <input type="checkbox" name="info_3" value="AttnAndrewMiller" id="info_3" />
          Message for Pastor Andrew Miller</label>
        <br />
        <label>
          <input type="checkbox" name="info_4" value="AttnStevenSpencer" id="info_4" />
          Message for Pastor Steven Spencer</label>
        <br />
        <label>
          <input type="checkbox" name="info_5" value="AttnTonya" id="info_5"  />
          Church Office</label>
        <br />
        <label>
          <input type="checkbox" name="info_6" value="other" id="info_6" />
          Other</label>
        <br />
      </p>
<br />
      <p> </p>
    <p><span id="sprytextarea1">
      <label for="content">Reason for Contact:</label>
      <br />
      <textarea name="content" id="content" cols="60" rows="10"></textarea>
      <span class="textareaRequiredMsg">Required.</span></span></p>
  </fieldset>
  <p>
    <input type="submit" name="submit" id="submit" value="SEND" />
    <input type="reset" name="reset" id="reset" value="RESET" />
  </p>
</form>
<p> </p>
</div>
<div id="clrbox"></div>
<div id="footer">

<p><strong><a href="index2.html">Home</a></strong>  |  <strong><a href="recjesus.html">Want to Know Jesus?</a></strong>  | <strong><a href="aboutus.html">About Us</a></strong> | <strong><a href="contactus.html">Contact Us</a></strong></p>
<h3>©Copyright 2012 Bluffton Church of the Nazarene</h3>
Site Designed By <a href="http://www.fishwithoutfeet.com"><span class="biz">Fish Without Feet Graphic Design</span></a>
</div></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"../SpryAssets/SpryMenuBarRightHover.gif"});
var spryradio1 = new Spry.Widget.ValidationRadio("spryradio1", {validateOn:["blur"]});
var sprytextarea1 = new Spry.Widget.ValidationTextarea("sprytextarea1", {validateOn:["blur"]});
var sprytextfield1 = new Spry.Widget.ValidationTextField("email", "email", {validateOn:["blur"]});
</script>
</body>
</html>

Edited by fwof1976
Link to comment
Share on other sites

I fixed that part, I had a double bit of info in there and added the headers.

"Reason for Contact: " . $_POST['content'];
$from = $_POST['email'];
$headers = "From: $from" . "\r\n";
$headers = "Bcc: fishwithoutfeet@yahoo.com" . "/r/n";
mail($to,$subject,$message,$headers);
?>

Unfortunately, problem not solved.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.