Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. problem occurred when using mail() function

problem occurred when using mail() function

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
helpphpquestion
6 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CoderForEver
    wrote on last edited by
    #1

    Hey my friends ... I was using mail() function but some error occured this is the code

    Thank you!
    </h1>
    <p>Email sent. We will contact you as soon as possible
    </p><p><br /></p>';

    }
    else
    echo 'not submitted';

    ?>

    when I use the above code this error occured

    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Hiwi\send.php on line 26
    Thank you!

    Email sent. We will contact you as soon as possible

    Can any body help me on this? I thought it was because I wasnt connected to the internet ..... even after I connected to the internet it comes again. Is it because my site is not posted ? I am just working on it.... Any suggestions .... Thank you

    F A 2 Replies Last reply
    0
    • C CoderForEver

      Hey my friends ... I was using mail() function but some error occured this is the code

      Thank you!
      </h1>
      <p>Email sent. We will contact you as soon as possible
      </p><p><br /></p>';

      }
      else
      echo 'not submitted';

      ?>

      when I use the above code this error occured

      Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Hiwi\send.php on line 26
      Thank you!

      Email sent. We will contact you as soon as possible

      Can any body help me on this? I thought it was because I wasnt connected to the internet ..... even after I connected to the internet it comes again. Is it because my site is not posted ? I am just working on it.... Any suggestions .... Thank you

      F Offline
      F Offline
      fly904
      wrote on last edited by
      #2

      CoderForEver wrote:

      Failed to connect to mailserver at "localhost"

      I take it you don't have an SMTP server on your localhost as that is what the error means. You need to configure your php.ini with SMTP settings for a different, external SMTP server if you don't have one installed on your localhost. You can find lots of information about your problem by doing a simple Google search[^] with your error message.

      If at first you don't succeed, you're not Chuck Norris.

      C 1 Reply Last reply
      0
      • F fly904

        CoderForEver wrote:

        Failed to connect to mailserver at "localhost"

        I take it you don't have an SMTP server on your localhost as that is what the error means. You need to configure your php.ini with SMTP settings for a different, external SMTP server if you don't have one installed on your localhost. You can find lots of information about your problem by doing a simple Google search[^] with your error message.

        If at first you don't succeed, you're not Chuck Norris.

        C Offline
        C Offline
        CoderForEver
        wrote on last edited by
        #3

        thank you man .... I already checked the SMTP .... I use Wamp Server just for to develop my websites. .... I will check ur soulutions Thank you.

        1 Reply Last reply
        0
        • C CoderForEver

          Hey my friends ... I was using mail() function but some error occured this is the code

          Thank you!
          </h1>
          <p>Email sent. We will contact you as soon as possible
          </p><p><br /></p>';

          }
          else
          echo 'not submitted';

          ?>

          when I use the above code this error occured

          Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Hiwi\send.php on line 26
          Thank you!

          Email sent. We will contact you as soon as possible

          Can any body help me on this? I thought it was because I wasnt connected to the internet ..... even after I connected to the internet it comes again. Is it because my site is not posted ? I am just working on it.... Any suggestions .... Thank you

          A Offline
          A Offline
          abushahin
          wrote on last edited by
          #4

          hey, although i havent tried emailing from my machine locally, just wondered if it was something to do with the mail client in your xammp control panel try turning on the mercury email client that should enable emailing from localhost. let me know if it works

          abushahin

          C 1 Reply Last reply
          0
          • A abushahin

            hey, although i havent tried emailing from my machine locally, just wondered if it was something to do with the mail client in your xammp control panel try turning on the mercury email client that should enable emailing from localhost. let me know if it works

            abushahin

            C Offline
            C Offline
            CoderForEver
            wrote on last edited by
            #5

            I have got one idea .. not zat much cool ... when I post my finished website ... zer will be a webserver which we will post on US ... I hope zis function is the purpose of zat machine ... wat do u tink so? ... I just use mail() function ... only

            A 1 Reply Last reply
            0
            • C CoderForEver

              I have got one idea .. not zat much cool ... when I post my finished website ... zer will be a webserver which we will post on US ... I hope zis function is the purpose of zat machine ... wat do u tink so? ... I just use mail() function ... only

              A Offline
              A Offline
              abushahin
              wrote on last edited by
              #6

              hey, i dont quite understand what you mean!

              abushahin

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups