警告:mail():无法连接到“localhost”端口25的邮件服务器,验证php.ini中的“SMTP”和“smtp_port”设置或使用C:\ Users中的ini_set()...
$from = 'myemail@gmail.com';
$to = 'clientemail@gmail.com';
$subject = "welcome";
$headers = 'From: '.$from;
$message = 'Hello!';
// Sending email
if(mail($to, $subject, $message, $headers))
{
echo 'Your mail has been sent successfully.';
} else
{
echo 'Unable to send email. Please try again.';
}