need help on this php email code

Discussion in 'HTML & Website Design' started by shanch123, Dec 24, 2007.

  1. #1
    i have tried this code to send to my email but it doesnt work. plz help

    also what is the "nubrs3.txt" for? does it get sent there?
     
    shanch123, Dec 24, 2007 IP
  2. Mooseman

    Mooseman Peon

    Messages:
    453
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I would help if you tell us what exactly is wrong. By just looking at it it looks like the mail(); is completely wrong.

    I'm not sure what exactly you are trying to send, but here's an example of what a php mail could look like:

    <?php
    
    $to = "somebody@example.com";
    $subject = "My subject";
    $txt = "Hello world!";
    $headers = "From: webmaster@example.com" . "\r\n" .
    "CC: somebodyelse@example.com";
    
    mail($to,$subject,$txt,$headers);
    ?>
    PHP:
    (Taken from w3schools)

    Right now it looks like you're trying to send a mail without a header, so I guess that's your problem. By removing the "@" infront of mail you should get some errors I think.

    (Shouldn't this be in PHP forum?)
     
    Mooseman, Dec 24, 2007 IP