[PHP] Mail wont send [PHP]

Results 1 to 6 of 6
  1. #1
    Vous Pas Reel HotelUnderSeige is offline
    MemberRank
    Nov 2007 Join Date
    ColoradoSpringsLocation
    1,290Posts

    [PHP] Mail wont send [PHP]

    Ok well heres the code
    PHP Code:
    <html><body>
    <form method="post"> 
    <select name="provider"> 
    <option>Tmobile</option>
    <option>Bell Canada</option>
    <option>AT&T/Cingular</option>
    <option>Boost Mobile</option>
    <option>Nextel</option>
    <option>Sprint</option>
    <option>Verizon</option>
    </select>
    Phone Number: <input name="number" type="text" /> 
    <br />
    Subject: <input name="subject" type="text" /> 
    <br />
    <textarea rows="5" cols="20" wrap="physical" name="message">
    Message Here
    </textarea>
    <br />
    <input type="submit" />
    </form>
    </body></html>
     
     
    <?php
    $number 
    =$_POST['number'];
    $provider =$_POST['provider'];

    if (
    $provider == "Tmobile") {
    $provider "tmomail.net";
    }
    if (
    $provider == "Bell Canada") {
    $provider "txt.bell.ca";
    }
    if (
    $provider == "AT&T/Cingular") {
    $provider "txt.att.net";
    }
    if (
    $provider == "Boost Mobile") {
    $provider "myboostmobile.com";
    }
    if (
    $provider == "Nextel") {
    $provider "messaging.nextel.com";
    }
    if (
    $provider == "Sprint") {
    $provider "messaging.sprintpcs.com";
    }
    if (
    $provider == "Verizon") {
    $provider "vmobl.com";
    }
    $to "$number@$provider";
    $subject =$_POST['subject'];
    $message =$_POST['message'];
    $from "antman6373@hotmail.com";
    /* To send HTML mail, you can set the Content-type header. */
    $headers1 "MIME-Version: 1.0\r\n";
    $headers1 .= "Content-type: text/html; charset=iso-8859-1\r\n";
    /* additional headers */
    $headers1 .= "To: ".$to."\r\n";
    $headers1 .= "From: ".$from."\r\n";
    $headers1 .= "Reply-To: ".$from."\r\n";
    ?>
    <?php
    mail
    ($to$subject$message$headers);

    ?> 
    <? echo("$number"); ?>
    <br />
    <? echo("$subject"); ?>
    <br />
    <textarea rows="5" cols="20" wrap="physical">
    <? echo("$message"); ?>
    </textarea>
    why wont it send?


  2. #2
    Gamma Daevius is offline
    MemberRank
    Jun 2007 Join Date
    NetherlandsLocation
    3,252Posts

    Re: [PHP] Mail wont send [PHP]

    You never set the header, you take var $header, but you filled $header1.

    Also, it's better to use PHPMailer or SwiftMailer, instead of mail().

    And:
    PHP Code:
    <? echo("$number"); ?>
    Should be this:
    PHP Code:
    <?php echo $number?>

  3. #3
    The Gamma..? EliteGM is offline
    MemberRank
    Jul 2006 Join Date
    NandolandLocation
    4,078Posts

    Re: [PHP] Mail wont send [PHP]

    Or:
    PHP Code:
    <?=$number;?>

  4. #4
    Account Upgraded | Title Enabled! passie is offline
    MemberRank
    Jan 2005 Join Date
    The NetherlandsLocation
    710Posts

    Re: [PHP] Mail wont send [PHP]

    Quote Originally Posted by EliteGM View Post
    Or:
    PHP Code:
    <?=$number;?>
    nop that's wrong you should know it,
    in higher php version that its blocked ..

  5. #5
    The Gamma..? EliteGM is offline
    MemberRank
    Jul 2006 Join Date
    NandolandLocation
    4,078Posts

    Re: [PHP] Mail wont send [PHP]

    I always used it ;0
    Too bad it's disabled >.>

  6. #6
    Vous Pas Reel HotelUnderSeige is offline
    MemberRank
    Nov 2007 Join Date
    ColoradoSpringsLocation
    1,290Posts

    Re: [PHP] Mail wont send [PHP]

    Quote Originally Posted by EliteGM View Post
    Or:
    PHP Code:
    <?=$number;?>
    ok the echoing of $number was not the problem it works fine lol



Advertisement