EvilZone

Programming and Scripting => Web Oriented Coding => : Al Capone January 01, 2014, 10:42:07 AM

: Problem Using PHP mail() function in wamp
: Al Capone January 01, 2014, 10:42:07 AM
i m having problem using the php mail function, i just get some kinda errors tho im pretty sure my code is working fine, after bit of googling, i found a solution about faking sendmail.exe but i can't seem to make it work..
pls can anyone who has done it in the past help me? thanks

- Al Capone
: Re: Problem Using PHP mail() function in wamp
: Kulverstukas January 01, 2014, 11:04:01 AM
Uhm I doubt you can use mail() on localhost. But I'm not sure.
In the past I had nothing but trouble with WAMP. I'd recommend to take a look at XAMPP.
: Re: Problem Using PHP mail() function in wamp
: Al Capone January 01, 2014, 11:10:56 AM
thanks for the reply but nevermind bro, i fixed it :) now working with php mail() flawlessly.
: Re: Problem Using PHP mail() function in wamp
: Kulverstukas January 01, 2014, 11:30:59 AM
Mind explaining how you fixed it?
: Re: Problem Using PHP mail() function in wamp
: Al Capone January 01, 2014, 12:30:35 PM
yea sure. perhaps i'll make a tut on that in next 3-4 hrs. :)
: Re: Problem Using PHP mail() function in wamp
: lucid January 01, 2014, 10:02:58 PM
yea sure. perhaps i'll make a tut on that in next 3-4 hrs. :)
Lol does it really warrant a full tutorial? If so then please do. It's good forum courtesy to explain how you fixed your errors so that future members may benefit.
: Re: Problem Using PHP mail() function in wamp
: Anks January 02, 2014, 08:55:26 AM
yea sure. perhaps i'll make a tut on that in next 3-4 hrs. :)

Before making it can u just provide a direction through which it worked.i mean using a SMTP server on your machine or making changes in the wamp itself?
: Re: Problem Using PHP mail() function in wamp
: Stackprotector January 02, 2014, 09:13:18 AM
Uhm I doubt you can use mail() on localhost. But I'm not sure.
In the past I had nothing but trouble with WAMP. I'd recommend to take a look at XAMPP.
Sure you can:) you just need sendmail or something else installed (sendmail is usually preinstalled)
: Re: Problem Using PHP mail() function in wamp
: Al Capone January 02, 2014, 05:55:27 PM
heres the TUT:
http://evilzone.org/web-oriented-programming/how-to-make-use-of-php-mail%28%29-function-in-windows-environment%28wamp%29/new/#new
: Re: Problem Using PHP mail() function in wamp
: ande January 02, 2014, 07:25:10 PM
Using the mail() function in PHP on most development environments will fail because there are no back-end mail server receiving the work. Most commonly this will fail on Windows, as Factionwars noted, sendmail is usually preinstalled with Linux).

One has to remember that the mail() function does very little. Its pretty much just a middle man between your app and the mail server. In order to get mail() to work on your machine you will need a mail server OR configure PHP to use a remote mail server.