@nunuaziz_,
try code739 recommendation first.. if it does not do the job.. try...
look inside your server's directory, look for a directory named send mail..and your local server should have a Mercury Mail in it or equivalent.
For Wampp and Xampp this directory is inside the installation dirctory, or the same level as the Apache directory.
Before posting your response, copy, paste to notepad, save as find.php in the htdocs dirctory of your localhost this code
<?php
phpinfo();
?>
Use your browser and point it to http://localhost/find.php ..
Locate "Loaded Configuration file" ... this will tell you which php.ini file is loaded or currently being use by your server.
Using a notepad or any suitable text editor.. open the php.ini file as shown by your phpinfo above.
IMPORTANT!!!! You need to have a gmail account for this work..
on your php.ini file as mentioned above, locate
[mail function]
find
SMTP = localhost
smtp_port = 25
sendmail_from = postmaster@localhost
change the above to
SMTP = smtp.gmail.com
smtp_port = 587
sendmail_from = YourAccountUserName@gmail.com
SAVE YOUR CHANGES.....
Second Step ... find the sendmail This is located or in the same level as the htdocs, apache, mysql, and phpMyAdmin..
Open the sendmail directory and locate the file named sendmail.ini
once again, find
smtp_server=localhost
smtp_port=25
;auth_username=
;auth_password=
change the above to this
;smtp_server=localhost
;smtp_port=25
;auth_username=
;auth_password=
JUst below the commented entries above, addd
smtp_server=smtp.gmail.com
smtp_port=587
auth_username= YourAccountUserName@gmail.com
auth_password= YourGmailAccountPassword
Save your changes on both files...
Re-start your server.. make sure this is done properly..
Test your php script.. it should be able to send email from your localhost using the gmail email account.
If you are on windows, make sure the firewall is not blocking the Mercury Mail or the mail service included in your local server..
I cannot show you how to send from generic mailer and I will never will not teach anyone how to do it, because of potential spammers are lurking all over the Internet.