/    Sign up×
Community /Pin to ProfileBookmark

Drop Down Select Mail Recipient

Hi Guys can some one tell me were i have gone wrong. i have a contact form with the option to select your Recipient via a drop down select box on a html page which gets posted to some php script which then redirects you to a thank you html page. But it’s just not working can some one please look at the script and point out the problem.

HTML Page:

<FORM ACTION=”post.php”>

<TABLE BORDER=0>
<TR VALIGN=”top”>
<TD width=”160″>&nbsp;</TD>
<TD width=”73″><span class=”style11″>Recipient:</span></TD>
<TD width=”458″><label>
<select name=”mailto”>
<option value=”[email protected]“>test1</option>
<option value=”[email protected]“>test2</option>
<option value=”[email protected]“>test3</option>
</select>
</label></TD>
</TR>
<TR VALIGN=”top”>
<TD>&nbsp;</TD>
<TD><span class=”style11″>Your Name:</span></TD>
<TD><input name=”name” type=”text” size=”30″ /></TD>
</TR>
<TR VALIGN=”top”>
<TD>&nbsp;</TD>
<TD><span class=”style11″>Your Email:</span></TD>
<TD><input name=”email” type=”text” size=”30″ /></TD>
</TR>
<TR VALIGN=”top”>
<TD>&nbsp;</TD>
<TD><span class=”style11″>Priority:</span></TD>
<TD><input name=”priority” type=”text” size=”30″ /></TD>
</TR>
<TR VALIGN=”top”>
<TD>&nbsp;</TD>
<TD><span class=”style11″>Subject:</span></TD>
<TD><input name=”subject” type=”text” size=”30″ /></TD>
</TR>
<TR VALIGN=”top”>
<TD>&nbsp;</TD>
<TD><span class=”style11″>Message:</span></TD>
<TD><label>
<textarea name=”message” cols=”35″ rows=”8″></textarea>
</label></TD>
</TR>
<TR>
<TD></TD>
<TD> </TD>
<TD><label>
<input type=”submit” name=”Submit” value=”Submit” />
</label>
<INPUT TYPE=”reset” VALUE=”Reset”></TD>
</TR>
</TABLE>
</FORM>

PHP Script:

<?php
// Receiving variables
@$mailto = addslashes($_POST[‘mailto’]);
@$name = addslashes($_
POST[‘name’]);
@$email = addslashes($_POST[’email’]);
@$priority = addslashes($_
POST[‘priority’]);
@$subject = addslashes($_POST[‘subject’]);
@$message = addslashes($_
POST[‘message’]);

// Validation
//Sending Email to form owner
$pfw_header = “From: $emailn”
. “Reply-To: $emailn”;
$pfw_subject = “Online Contact Form”;
$pfw_email_to = “$mailto”;
$pfw_message = “mailtoperson: $mailtopersonn”
. “n”
. “name: $namen”
. “n”
. “email: $emailn”
. “n”
. “priority: $priorityn”
. “n”
. “subject: $subjectn”
. “n”
. “message: $messagen”;
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;

header(“Location: thankyou.html”);

?>

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@abou_hmedJun 17.2007 — what kind of problems or errors you r facing?
Copy linkTweet thisAlerts:
@aiden857181authorJun 17.2007 — I don't seem to be receiving the mail.
Copy linkTweet thisAlerts:
@abou_hmedJun 17.2007 — it dont seems that you have a problem on the code,

r using ur localhost or the online server, and did u ever send any email before?
Copy linkTweet thisAlerts:
@aiden857181authorJun 17.2007 — i have used this php script before but not for a drop down select recipient. as you can tell im trying to use the value of the select box as the mailto recipient address but noting is working. it not on the server side of things because if i take out the mailto value in the php script and replace it with an email address it sends it. So im stumped.
Copy linkTweet thisAlerts:
@aiden857181authorJun 17.2007 — got it sorted thanks for your help.
Copy linkTweet thisAlerts:
@abou_hmedJun 17.2007 — gr8 , but was the prb?
×

Success!

Help @aiden857181 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...