php mail() function and configuration settings

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poopsy
    New Member
    • Nov 2006
    • 50

    php mail() function and configuration settings

    Hello all,
    I have been trying to send email using the php mail functions..I have tried different examples but i keep getting the same error:
    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\... etc

    I have tried googling the answer but i dont undertand the SMTP thing..from what i've understood there is some configuration settings i must change in the php.ini file???

    i have wamp server installed with php version 5.2.5

    thx for ur help
  • hoopy
    New Member
    • Feb 2009
    • 88

    #2
    Hi, you need to actually have a mail server running locally if you wish to send mail through it. This is why the error, as there is none in your case.

    If you POP an account somewhere you can use one of the mailer classes like PHPMailer or Swift Mailer to send your emails out via PHP.

    Comment

    • poopsy
      New Member
      • Nov 2006
      • 50

      #3
      hmmm i dont quite understand..cou ld use plz explain what i need to do to be able to send mails??

      Comment

      • devsusen
        New Member
        • Feb 2007
        • 136

        #4
        To send mail using php mail() function or by using some other classes you require a mail server. Wamp server doesn't install any mail server. This is the reason why you are getting the error. php mail() function uses the mail server situated in the localhost. This is the basic function provided by to send mail.

        Now if you use mail classes like PHPMailer or Swift Mailer then you can send mail using POP account. In that case these mail classes will send mail via the mail server of the email account.

        Hope this will help you.

        Comment

        • poopsy
          New Member
          • Nov 2006
          • 50

          #5
          Yep..thx for the reply

          Comment

          Working...