Jump to content

mail($to, $subject, $message, $headers); not working???


helloise

Recommended Posts

please help, here is all my code:

<div id='div_phone_big'>
</div>

<head>
<script type="text/JavaScript">
  function getChoice(val)
  {
      yesNo = new Array("Yes", "No");
      var getsel = document.contactus.yesnolist.value;
      var e = document.getElementById("yesnolist");
      var strUser = e.options[e.selectedIndex].value;
      if (strUser == "no")
      {
          //alert('lakjdlakjsdlajd');
           window.location.href = "http://www.rainbowcode.net/index.php/util/faq";
           //document.write(window.location.href);
           window.location('http://www.rainbowcode.net/index.php/util/faq');
      }
      else
      {
          document.contactus.emailreply.value = "";
          document.contactus.commtext.value = "";
          document.contactus.message.value = "";
          document.contactus.commlist.value = "";
      }
      return strUser;
  }
  
  function getCommChoice(x)
  {
      comm = new Array("Compliment","Complaint","Feedback","Suggestion","Billing Query","Other");
      var getsel = document.contactus.commlist.value;
      document.contactus.message.value = comm[getsel];
      return document.contactus.message.value;
  }
  
  function sayThanks()
  {
      alert("Thank you for submitting");
      return true;
  }
</script>
</head>

<body>
<form name = "contactus" method="post" onSubmit="return sayThanks()">

<table class='table_format_content_rbc' border='0'>
<div>
<span class='spn_big_lightblue_rbc'>RAINBOW</span><span class='spn_big_black_rbc'>CODE:    CONTACT US </span>
    <td colspan='3' align='left' class='small_header_rbc'> 
    <h3>Problems and general queries</h3>
        <li>Phone our call centre on 086 110 6472 ( Available  8am-5pm from monday-friday ) or</li>
        <li>Email us at 
       <a href="mailto:helloise@pagesalive.co.za">feedback@miranetworks.net</a>
       </li>
    </td>   
</div>        

<div>     
<tr></tr>
<tr></tr>  
<tr>
	<td colspan='3' align='left' class='small_header_rbc'> 
         <h3>Frequently Asked Questions</h3>
	    <li>Please take a moment to read the Frequently Asked Questions as the solution to your query could be waiting for you there!</li>
            <li>Have you read the <?php echo link_to('FAQ','util/faq') ?> ? 
                 <select id="yesnolist" onChange="getChoice(this.value)">
                    <option value="yes" selected="selected">Yes</option>
                    <option value="no">No</option>
                 </select>
            </li>    
    </tr>  
    <tr></tr>  
    <tr></tr>  
</div>

<div>
    <tr>
	<td colspan='3' align='left' class='small_header_rbc'> 
        <h3>Feedback and Suggestions</h3>
                </select>     
           </li> 
           
                 <textarea name="message" rows="10" cols="20"></textarea>
                  <br /><br />
                  <?php
                        $to      = "helloise@pagesalive.co.za";
                        $subject = $_REQUEST["commlist"];
                        $email = $_REQUEST["emailreply"];
                        $message = $_REQUEST["message"];
                        $headers = "From: $email";
                        mail($to, $subject, $message, $headers);
                        ?>
                 <input type="submit" value="Send">
                 <input type="reset" value="Reset">
           

	</td>
</tr>
</div>    
</table>


<table class='table_format_content_rbc' border='0'>
<tr>	
	<td colspan='3' align='left' class='small_header_rbc'> 
		<br/>
	</td>
<tr>
</table>
</form>
</body>

and also set the php.ini file portion:
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = /usr/sbin/sendmail -t

and also ran:
$ sudo echo "test" | mail -s "test" helloise@pagesalive.co.za
The program 'mail' can be found in the following packages:
* heirloom-mailx
* mailutils

please help??                 <option value="feedback">Feedback</option>
                    <option value="suggestion">Suggestion</option>
                    <option value="billquery">Billing Query</option>
                    <option value="other">Other</option>
                </select>     
           </li> 
           
                 <textarea name="message" rows="10" cols="20"></textarea>
                  <br /><br />
                  <?php
                        $to      = "helloise@pagesalive.co.za";
                        $subject = $_REQUEST["commlist"];
                        $email = $_REQUEST["emailreply"];
                        $message = $_REQUEST["message"];
                        $headers = "From: $email";
                        mail($to, $subject, $message, $headers);
                        ?>
                 <input type="submit" value="Send">
                 <input type="reset" value="Reset">
           

	</td>
</tr>
</div>    
</table>


<table class='table_format_content_rbc' border='0'>
<tr>	
	<td colspan='3' align='left' class='small_header_rbc'> 
		<br/>
	</td>
<tr>
</table>
</form>
</body>

and also set the php.ini file portion:
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = /usr/sbin/sendmail -t

and also ran:
$ sudo echo "test" | mail -s "test" helloise@pagesalive.co.za
The program 'mail' can be found in the following packages:
* heirloom-mailx
* mailutils

please help??

Link to comment
Share on other sites

i did not post all my code...oops, here it is:

<div id='div_phone_big'>
</div>

<head>
<script type="text/JavaScript">
  function getChoice(val)
  {
      yesNo = new Array("Yes", "No");
      var getsel = document.contactus.yesnolist.value;
      var e = document.getElementById("yesnolist");
      var strUser = e.options[e.selectedIndex].value;
      if (strUser == "no")
      {
          //alert('lakjdlakjsdlajd');
           window.location.href = "http://www.rainbowcode.net/index.php/util/faq";
           //document.write(window.location.href);
           window.location('http://www.rainbowcode.net/index.php/util/faq');
      }
      else
      {
          document.contactus.emailreply.value = "";
          document.contactus.commtext.value = "";
          document.contactus.message.value = "";
          document.contactus.commlist.value = "";
      }
      return strUser;
  }
  
  function getCommChoice()
  {
      comm = new Array("Compliment","Complaint","Feedback","Suggestion","Billing Query","Other");
      var getsel = document.contactus.commlist.value;
      document.contactus.message.value = comm[getsel];
      //return document.contactus.message.value;
  }
  
  function sayThanks()
  {
      alert("Thank you for submitting");
      return true;
  }
</script>
</head>

<body>
<form name = "contactus" method="post" onSubmit="return sayThanks()">

<table class='table_format_content_rbc' border='0'>
<div>
<span class='spn_big_lightblue_rbc'>RAINBOW</span><span class='spn_big_black_rbc'>CODE:    CONTACT US </span>
    <td colspan='3' align='left' class='small_header_rbc'> 
    <h3>Problems and general queries</h3>
        <li>Phone our call centre on 086 110 6472 ( Available  8am-5pm from monday-friday ) or</li>
        <li>Email us at 
       <a href="mailto:helloise@pagesalive.co.za">feedback@miranetworks.net</a>
       </li>
    </td>   
</div>        

<div>     
<tr></tr>
<tr></tr>  
<tr>
	<td colspan='3' align='left' class='small_header_rbc'> 
         <h3>Frequently Asked Questions</h3>
	    <li>Please take a moment to read the Frequently Asked Questions as the solution to your query could be waiting for you there!</li>
            <li>Have you read the <?php echo link_to('FAQ','util/faq') ?> ? 
                 <select id="yesnolist" onChange="getChoice(this.value)">
                    <option value="yes" selected="selected">Yes</option>
                    <option value="no">No</option>
                 </select>
            </li>    
    </tr>  
    <tr></tr>  
    <tr></tr>  
</div>

<div>
    <tr>
	<td colspan='3' align='left' class='small_header_rbc'> 
        <h3>Feedback and Suggestions</h3>
            <li>E-mail address to reply to:
              <input type="text" name="emailreply">
            </li>
            <li>Nature of communication:       
                <select name="commlist" onChange="getCommChoice()">
                    <option value="compliment">Compliment</option>
                    <option value="complaint">Complaint</option>
                    <option value="feedback">Feedback</option>
                    <option value="suggestion">Suggestion</option>
                    <option value="billquery">Billing Query</option>
                    <option value="other">Other</option>
                </select>     
           </li> 
                 <textarea name="message" rows="10" cols="20"></textarea>
                  <br /><br />
                  <?php
                        $to      = "helloise@pagesalive.co.za";
                        $subject = $_POST["commlist"];
                        $message = $_POST["message"];
                        $from = $_POST["emailreply"];
                       
                        $headers = "From: ".$from;
                        mail($to, $subject, $message, $headers);
                        ?>
                 <input type="submit" value="Send">
                 <input type="reset" value="Reset">
	</td>
</tr>
</div>    
</table>	
<table class='table_format_content_rbc' border='0'>
<tr>	
	<td colspan='3' align='left' class='small_header_rbc'> 
		<br/>
	</td>
<tr>
</table>
</form>
</body>

 

 

please help?

thank you

Link to comment
Share on other sites

Ok, 2 questions one already asked.. But Ill ask again, Are you attempting to work with this on your own private enviroment locally through the use of a home brew server like lets say "WAMP", or "XAMP" or anything like that. Cause if you are, chances are unless you have a mail server on that same system of some sort your not going to be able to get mail out. Otherwise you would be testing this on a hosting service, hostgator, enom, godaddy, other, something your paying for that your uploading to then testing.. If its godaddy, that could be one of your issues right there, as godaddy requires you to go through a special means of sending mail through there system through your site..

 

If its not godaddy, and its not your own local enviroment. Then the second question would be.. is what is the specific error message your seeing?

Link to comment
Share on other sites

here at work i run

 

ubuntu 10.04

php: 5.3.2

symfony 1.4.2

apache2

and gmail

os: 'Linux helloise 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686'

 

so im in a work environment where everything is set up..nothing "home brewed" :)

i dont get any error messages the mail just does not come through on my gmail :)

 

im only but 6 months new in all of this stuff..so sorry if i dont know what you are talking about

 

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.