如何使用localhost / xampp发送电子邮件?

时间:2015-07-02 06:30:27

标签: php email xampp localhost

我是php的新手,我想使用localhost / xampp发送电子邮件,我尝试了一切,但没有运气。我尝试更改php.ini文件,sendmail,sendmail路径,端口和cofig我的Gmail详情(gmail id,密码)。完成stackoverflow教程中提到的所有内容。

我的电子邮件地址

    $to= 'email@gmail.com';
    $subject = 'the subject';
    $message = 'hello';
    $headers = 'From: webmaster@example.com' . "\r\n" .     'Reply-To: webmaster@example.com' . "\r\n" .     'X-Mailer: PHP/' . phpversion(); 
    $ans = mail($to, $subject, $message, $headers);
    var_dump($ans); 

0 个答案:

没有答案
相关问题