Ok,

So im working localy at the moment using xampp. I want to know how to enable the PHP mail() Function so i can send emails from my webpages.

I want to be able to use a form to send an email on my website.

I remember reading that you have to make some changes to a apache file? I did google it but could'nt really work out what i need to do.

Please could someone guide me though what i need to do ?

Also when i come to upload my website to my host will i need to do any thing else to enable it on my live site on my host???

thanks 🙂

    Normally xampp has is already enabled for you?
    Check your phpinfo for mail possibly?

    Usually mail is enabled on servers that I have used also.

      i get this error when i try to use the mail();

      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:\xampp\htdocs\test2\mailtest.php on line 7

        yes because your server is not configured as a mailserver 😉

        You need to set one up.

          ok in php.ini you have to set .

          SMTP = (Your smtp) e.g. smtp.example.com

          smtp_port = 25

          Hope this is all setup for me on my host ! Anyone know what i do if it isnt ???????

            Note that with PHPMailer (which I also often use) it comes with its own SMTP class which you can use to send your mail via whatever SMTP service you have access to. This way there is no need to have a mail server running on your PC. It also takes care of a lot of the details for things like sending attachments that I'd just as soon not have to worry about myself.

              Write a Reply...