By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,746 Members | 1,865 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,746 IT Pros & Developers. It's quick & easy.

PHP email script

P: 3
Now this sounds simple i thought it was but it doesnt seem to be working. The code i am using is,

$domain = GetHostByName($REMOTE_ADDR);
$emailtoadd = "$person @****.biz, info@****.biz, josh@****.biz";
$too = "$emailtoadd";

$msg .= "Name: $name\n";
$msg .= "Email: $email\n";
$msg .= "Subject: $subject\n";
$msg .= "Comment: $comment\n";
$msg .= "IP Address: $domain\n";

$headers = "From: $email" . "\r\n" .
"Reply-To: $email" . "\r\n" .
"X-Mailer: PHP/" . phpversion();

mail($too, "**** Contact Form", $msg, $headers);

Right, My problem is,
I need a PHP script to send an email to a specific address@****.biz. Eg, someone selects value2 in the drop down selection list in a web form and the value is sent to a PHP script which send an email to value2@***.biz, info@***.biz, josh@****.biz.

With me? Well if you understand this please reply! I need it for my "Business" Im 14 and decided to start my own business :) make money out of my skills =D

Thanks alot in advance.

Josh Bonfield

email address removed due to forum rules - moderator
Feb 5 '07 #1
Share this Question
Share on Google+
5 Replies

Expert 2.5K+
P: 3,235
Welcome to The Scripts.
First off, you are going to need to remove the space between $person and @.
Feb 5 '07 #2

P: 3
Welcome to The Scripts.
First off, you are going to need to remove the space between $person and @.
Yes, I only did that to see if that was the problem, I then echo'ed it to see but the variable was not echo'ing. Thats why the space is there.
Feb 5 '07 #3

Expert 2.5K+
P: 3,235
What exactly is the problem with the script? What is happening that shouldn't? What isn't happening that should? Are you getting any errors printed on the screen? Does the error log give you any messages?
Feb 5 '07 #4

Expert 2.5K+
P: 4,258
Maybe you did, I can't see it, but where did you get these variables filled:
Expand|Select|Wrap|Line Numbers
  1. $person
  2. $name
  3. $email
  4. $subject
  5. $comment
Ronald :cool:
Feb 5 '07 #5

P: 3
They are submitted by a form. Maybe if i just say,
can you please write me a script that sends an email to a specified recepient from a drop down menu in a web form. Thats all i am trying to do. Thanks, Josh Age 14
Feb 6 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.