having an error that is giving me problems when using mail function in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matiruv
    New Member
    • Sep 2008
    • 7

    having an error that is giving me problems when using mail function in php

    Warning: mail() [function.mail]: Failed to connect to mailserver at "192.168.0. 254" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\sel ection\Untitled-6.php on line 16
    Mail Sent.
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    is that IP address a valid mail (SMTP) server?

    If so, can you telnet to it on port 25?

    How: open command line type telnet <ipaddress> 25

    post the response here.

    Comment

    • matiruv
      New Member
      • Sep 2008
      • 7

      #3
      the SMTP is valid because it is the one we use to access our local mail on our mailserver.at 192.168.0.254

      now for port 25 when i did the telnet thingy on port 25 like telnet 25
      it is giving me this error:
      could not open connection to the host,on port 23: connection failed

      Comment

      • kaushtuv
        New Member
        • Jul 2014
        • 3

        #4
        Code:
        $from ="<!--EMAIL ADDRESS-->";
        $headers  = "From:" .$from. "\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
        
        mail($to,$subject,$txt,$headers);
        //$txt will contain the text want to sent in html format.
        Last edited by Rabbit; Jul 30 '14, 03:45 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.

        Comment

        Working...