Page 1 of 1

email dropdown

Posted: Wed Oct 26, 2011 9:56 pm
by d1lu5ion
Hi everyone, I am trying to create an email page that when someone goes to it they have to fill in there name, select an email from the dropdown menu and then type a message in.. it sounds easy but Im having a real hard time.. when they get to the page the emails should already be in there from a file created with php..

my code is way off but I am still learning...

<form action="email.php">
<input type="submit name="email">

send you to the page with the dropdown menu..

<html>
<head></head>

<body>

<br />

To:
<select>
<option value="email">man@hotmail.com</option>
<option value="email2">dumb@rogers.com</option>
<option value="email3">junk@mts,net</option>
<option value="email4">test@mts.net</option>
</select>

<br />
from:<input type="text" name="email"> <br />
Subject:<textarea> </textarea> <br />
<input type="submit">


</body>
</html>

is the page with the dropdown menu

and this is the php code...

Code: Select all

<?php 
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name \n Message: $message";
$recipient = "emailaddress@here.com<script type="text/javascript">
/* <![CDATA[ */
(function(){try{var s,a,i,j,r,c,l=document.getElementById("__cf_email__");a=l.className;if(a){s='';r=parseInt(a.substr(0,2),16);for(j=2;a.length-j;j+=2){c=parseInt(a.substr(j,2),16)^r;s+=String.fromCharCode(c);}s=document.createTextNode(s);l.parentNode.replaceChild(s,l);}}catch(e){}})();
/* ]]> */
</script>";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!";
?>

I'm sorry if I did not quote this properly...

I am having a really hard time trying to create the coding for this. :( All the help is appreciated!

Re: email dropdown

Posted: Thu Oct 27, 2011 1:08 am
by social_experiment
d1lu5ion wrote:it sounds easy but Im having a real hard time.. when they get to the page the emails should already be in there from a file created with php..
What type of file will the emails be read from & can you paste an example of what the file contents would look like?