简体   繁体   中英

php can't send email

I have been trying to send a php contact form, but it's not working at all. my xampp use 8080 port.

I though that I have to change some configuration on php.ini or httpd.conf as well.

Please anybody help me.

Thank you.

this is the script:

    <?php
    $to = "tiya.vort4@gmail.com";
    $subject = "Test mail";
    $message = "Hello! This is a simple email message.";
    $from = "someonelse@example.com";

    $headers = 'From: '.$from."\r\n".
   'Reply-To: '.$from."\r\n" .
   'X-Mailer: PHP/' . phpversion();

   if(mail($to,$subject,$message,$headers)){
     echo "Mail Sent.";
   }

您必须配置与xampp捆绑在一起的水银服务器 ,才能实际传递/中继邮件。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM