I am creating a contact form that has different subject options:
Sponsorship Information
Member Information
Marketing Information
Sales and Advertising
Website Question
Other
What I need to happen is to have the message be sent to a different person depending on which selection is made.
This is what I tried…I just moves to the bottom ‘if’ statement and send to that address.
<?php
// get the variables from the URL request string
$name = $_REQUEST['name'];
$company = $_REQUEST['company'];
$email = $_REQUEST['email'];
$ssubject = $_REQUEST['subject'];
$comments = $_REQUEST['comments'];
// Variables for who's email it should go to:
if($ssubject = "Sponsor Information") {
$mailto = "setha@comporium.net";
}
if($ssubject = "Member Information") {
$mailto = "saldridge@yeacharlotte.org";
}
if($ssubject = "Marketing Information") {
$mailto = "seth@sethaldridge.com";
}
else($mailto = "setha@comporium.net");
// Send the email to me!
$to = "$mailto";
$subject = "$ssubject";
$body = "The following is a message from YEA Charlotte's website.
Name: $name
Company: $company
Email: $email
Comments: $comments
Please respond to this message as soon as possible.
Thank you,
Admin
www.YEACharlotte.org";
$from = "FROM: $email";
$response = mail($to, $subject, $body, $from);
// If the email successfully sends go to header, else show message!
if($response)
{
header("location: http://www.yeacharlotte.org/contacts.html");
}
else
{
echo("Message was not able to send!");
}
?>