mail() function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lurryhomwa
    New Member
    • Jun 2007
    • 3

    mail() function

    hi people sorry to bother you with this Question but i am straggling i am nbew to php but i realy keen to use it, the thing is i am trying to use the mail function to receive information from a form but nothing seems to work my code is like this and my php. ini file lookes like this respectively.
    [code=php]
    <?
    $email = $_REQUEST['email'];
    $message = $_REQUEST['message'];

    mail ("user@domain.c om", "Feedback From Results",
    $message, "from: $email");


    ?>
    [/code]

    php.ini
    Code:
    [mail function]
    ; For Win32 only.
    SMTP =smtp.blueyonder.co.uk
    
    ; For Win32 only.
    sendmail_from = user@domain.com
    rember i am using my localhost.

    please help.
    Lurryhomes
    Last edited by Atli; Jun 27 '07, 11:24 AM. Reason: Added code tags, and removed email.
  • epots9
    Recognized Expert Top Contributor
    • May 2007
    • 1352

    #2
    Originally posted by lurryhomwa
    hi people sorry to bother you with this Question but i am straggling i am nbew to php but i realy keen to use it, the thing is i am trying to use the mail function to receive information from a form but nothing seems to work my code is like this and my php. ini file lookes like this respectively.
    [code=php]
    <?
    $email = $_REQUEST['email'];
    $message = $_REQUEST['message'];

    mail ("user@domain.c om", "Feedback From Results",
    $message, "from: $email");


    ?>
    [/code]

    php.ini
    Code:
    [mail function]
    ; For Win32 only.
    SMTP =smtp.blueyonder.co.uk
    
    ; For Win32 only.
    sendmail_from =user@domain.com
    rember i am using my localhost.

    please help.
    Lurryhomes
    Hi lurryhomwa welcome to TSDN,

    try this:
    [PHP]
    mail ("user@domain.c om", "Feedback From Results", $message, "from:".$email) ;
    [/PHP]

    good luck
    Last edited by Atli; Jun 27 '07, 11:25 AM. Reason: Removed email.

    Comment

    • lurryhomwa
      New Member
      • Jun 2007
      • 3

      #3
      Originally posted by epots9
      Hi lurryhomwa welcome to TSDN,

      try this:
      [PHP]
      mail ("user@domain.c om", "Feedback From Results", $message, "from:".$email) ;
      [/PHP]

      good luck
      cheers mate

      but this is what come back

      Warning: Failed to Connect in l:\program files\webroot\s endmail.php on line 5

      so i am not sure is there something with my php/apache i dont know?

      Comment

      • epots9
        Recognized Expert Top Contributor
        • May 2007
        • 1352

        #4
        ok, try removing the "from".
        [PHP]mail ("user@domain.c om", "Feedback From Results", $message);[/PHP] since the from is already in your php.ini

        and/or in your php.ini, what is your smtp_port set to? (default: smtp_port = 25)

        Comment

        • lurryhomwa
          New Member
          • Jun 2007
          • 3

          #5
          Originally posted by epots9
          ok, try removing the "from".
          [PHP]mail ("user@domain.c om", "Feedback From Results", $message);[/PHP] since the from is already in your php.ini

          and/or in your php.ini, what is your smtp_port set to? (default: smtp_port = 25)

          that still did not work but
          SMTP =smtp.blueyonde r.co.uk

          that is what i set to in php.ini file

          do u have any exmple of how ur php.in file will look like on the mail function

          Comment

          • epots9
            Recognized Expert Top Contributor
            • May 2007
            • 1352

            #6
            SMTP = my_outgoing_mai l_server
            smtp_port = 25

            all u have to do is add "smtp_port = 25" (no quotes) under smtp if it isn't already there.

            Comment

            Working...