Closed Thread
Results 1 to 3 of 3

Thread: What is with mail()??

  1. #1
    [...] Cyber is an unknown quantity at this point
    Join Date
    May 2001
    Location
    USA
    Posts
    2,441

    What is with mail()??

    i'm using this code to submit a form to me. (im using discount-hosting.com, it supports the mail() function) why doesnt it work after i send it?

    (the real email has been replaced by a fake)

    THE CODE:

    PHP Code:
    <? 
    if ($submit) { 
        
    mail("fakefakemail@hotmail.com""Managers Report from $name_of_person_making_report""Report from: $name_of_person_making_report\n\nGame Date: $Gamedate\nField: $Field\nOur Team: $OurTeam\nOpponent: $OpponetTeam\nGame 1 (Our Team): $ourteam_game1\nGame 1 (Opponent): $opponent_game1\n\nGame 2 (Our Team): $ourteam_game2\nGame 2 (Opponent): $opponent_game2\n\nGame 3 (Our Team): $ourteam_game3\nGame 3 (Opponent): $opponent_game3\n\nOur Team's winning and losing pitchers:\nGame 1: $twalp_1\nGame 2: $twalp_2\nGame 3: $twalp_3\n\nUmpire Ratings:\nUmpire 1: $umpirename_1\nOnly Ump or 1st game at plate: $aa\nStrike Zone: $bb\nBase Coverage: $cc\nAttitude: $cc\n\nUmpire 2: $umpirename_2\nSecond Game at Home Plate: $dd\nStrike Zone: $ee\nBase Coverage: $ee\nAttitude: $ff\n\nIllegal Pitches: $illegal_pitches\nUniform: #$uniform_number\nName: $name\nNumber of opponent team players in uniform at start of first game: $name_of_opponent_team_players_in_uniform_at_start_of_first_game""From: $name_of_person_making_report<manager_report@$SERVER_NAME>\nX-Sender: <manager_report@$SERVER_NAME>\nX-Mailer: PHP\n"); 

    ?>
    Cyber

  2. #2
    anti-liberal keith is an unknown quantity at this point keith's Avatar
    Join Date
    Oct 2000
    Location
    Buttsville
    Posts
    2,375
    i don't feel like looking through all of that because it's kind of long and drawn out... you sure you have the fields formatted correctly?
    PHP Code:
    <?
    mail
    ($recipient$subject$message$headers);
    ?>
    Last edited by keith; January 27th, 2002 at 15:12.
    w3rd

  3. #3
    Pro Member agent007 is an unknown quantity at this point
    Join Date
    Sep 2001
    Posts
    303

    Re: What is with mail()??

    PHP Code:
    <? 
    if ($submit) { 
        
    mail("fakefakemail@hotmail.com""Managers Report from $name_of_person_making_report""Report from: $name_of_person_making_report\n\nGame Date: $Gamedate\nField: $Field\nOur Team: $OurTeam\nOpponent: $OpponetTeam\nGame 1 (Our Team): $ourteam_game1\nGame 1 (Opponent): $opponent_game1\n\nGame 2 (Our Team): $ourteam_game2\nGame 2 (Opponent): $opponent_game2\n\nGame 3 (Our Team): $ourteam_game3\nGame 3 (Opponent): $opponent_game3\n\nOur Team's winning and losing pitchers:\nGame 1: $twalp_1\nGame 2: $twalp_2\nGame 3: $twalp_3\n\nUmpire Ratings:\nUmpire 1: $umpirename_1\nOnly Ump or 1st game at plate: $aa\nStrike Zone: $bb\nBase Coverage: $cc\nAttitude: $cc\n\nUmpire 2: $umpirename_2\nSecond Game at Home Plate: $dd\nStrike Zone: $ee\nBase Coverage: $ee\nAttitude: $ff\n\nIllegal Pitches: $illegal_pitches\nUniform: #$uniform_number\nName: $name\nNumber of opponent team players in uniform at start of first game: $name_of_opponent_team_players_in_uniform_at_start_of_first_game""From: $name_of_person_making_report<manager_report@$SERVER_NAME>\nX-Sender: <manager_report@$SERVER_NAME>\nX-Mailer: PHP\n"); 

    ?>
    Instead of doing it like that, I would assign a variable to your message so it will be less confusing. Here's what I would do:

    PHP Code:
    $message "Report from: $name_of_person_making_report

    Game Date: $Gamedate
    Field: $Field
    Our Team: $OurTeam
    Opponent: $OpponetTeam
    Game 1 (Our Team): $ourteam_game1
    Game 1 (Opponent): $opponent_game1

    Game 2 (Our Team): $ourteam_game2
    Game 2 (Opponent): $opponent_game2

    Game 3 (Our Team): $ourteam_game3
    Game 3 (Opponent): $opponent_game3

    Our Team's winning and losing pitchers:
    Game 1: $twalp_1
    Game 2: $twalp_2
    Game 3: $twalp_3

    Umpire Ratings:
    Umpire 1: $umpirename_1
    Only Ump or 1st game at plate: $aa
    Strike Zone: $bb
    Base Coverage: $cc
    Attitude: $cc

    Umpire 2: $umpirename_2
    Second Game at Home Plate: $dd
    Strike Zone: $ee
    Base Coverage: $ee
    Attitude: $ff

    Illegal Pitches: $illegal_pitches
    Uniform: #$uniform_number
    Name: $name
    Number of opponent team players in uniform at start of first game: $name_of_opponent_team_players_in_uniform_at_start_of_first_game"
    ;
    $recipient "YourEmail@YourDomain.Com";
    $subject "Managers Report from $name_of_person_making_report";
    $from "From: $name_of_person_making_report"
    mail($recipient$subject$message$from); 
    That makes it a lot easier to edit your message.
    EterNETy - Connecting artists and writers across the world.

Closed Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts