PHP email script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jbukdes
    New Member
    • Feb 2007
    • 3

    PHP email script

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

    [PHP]<?
    $domain = GetHostByName($ REMOTE_ADDR);
    ?>
    <?
    $emailtoadd = "$person @****.biz, info@****.biz, josh@****.biz";
    ?><?PHP
    $too = "$emailtoad d";

    $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);
    ?>[/PHP]

    Right, My problem is,
    I need a PHP script to send an email to a specific address@****.bi z. 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
  • Motoma
    Recognized Expert Specialist
    • Jan 2007
    • 3236

    #2
    Welcome to The Scripts.
    First off, you are going to need to remove the space between $person and @.

    Comment

    • jbukdes
      New Member
      • Feb 2007
      • 3

      #3
      Originally posted by Motoma
      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.
      Thanks

      Comment

      • Motoma
        Recognized Expert Specialist
        • Jan 2007
        • 3236

        #4
        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?

        Comment

        • ronverdonk
          Recognized Expert Specialist
          • Jul 2006
          • 4259

          #5
          Maybe you did, I can't see it, but where did you get these variables filled:
          Code:
          $person
          $name
          $email
          $subject
          $comment
          Ronald :cool:

          Comment

          • jbukdes
            New Member
            • Feb 2007
            • 3

            #6
            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

            Comment

            Working...