PHP问题本地主机可以发送php-mail吗? | php.ini可能无法正常工作

时间:2019-02-02 22:13:05

标签: php email phpmailer

  

警告:mail():无法连接到“ smtp.gmail.com”上的邮件服务器   端口465,请在php.ini中验证您的“ SMTP”和“ smtp_port”设置或使用   第17行的D:\ Xampp_Programm \ htdocs \ testen3.php中的ini_set()

这是我的问题...

   <?php 
    ini_set('SMTP','smtp.gmail.com');
    ini_set('smtp_port',465);
    $to = 'xyz';
    $headers  = "MIME-Version: 1.0" . "\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
    $headers  .= "From: xyz<xyz@gmail.com>" . "\r\n";
    $subject = "Confirmation For Request";
    $message = '<html>
                    <body>
                        <p>Hi xyz</p>
                        <p>
                            We recieved below details from you. Please use given Request/Ticket ID for future follow up:
                        </p>
                    </body>
                </html>';
    mail( $to, $subject, $message, $headers ); 
    ?>

这是我的代码...

是XAMPP不支持此选项吗? 我怎么可以改变我的脚本?

感谢您的帮助, JanF

0 个答案:

没有答案