i want so send email from localhost in WAMP server using PHP -
this question has answer here:
- configure wamp server send email 7 answers
i have tried send email localhost in wamp server shows me error:
mail(): failed connect mailserver @ "localhost" port 25, verify "smtp" , "smtp_port" setting in php.ini or use ini_set()
i have edited php.ini file like:
[mail function] ; win32 only. ; http://php.net/smtp smtp = localhost ; http://php.net/smtp-port smtp_port = 25
my php file code :
$to = '$rowemail["email"]'; $subject = 'testing sendmail.exe'; $message = 'hi, received email using sendmail!'; $headers = 'from: [memarez@gmail.com' . "\r\n" . 'mime-version: 1.0' . "\r\n" . 'content-type: text/html; charset=utf-8'; if(mail($to, $subject, $message, $headers)) echo "email sent"; else echo "email sending failed";
check http://www.developerfiles.com/how-to-send-emails-from-localhost-apachephp-server/
however, suggest use libraries phpmailer send emails via smtp .. https://github.com/phpmailer/phpmailer
Comments
Post a Comment