Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用XAMPP发送邮件时出错_Php_Xampp - Fatal编程技术网

Php 使用XAMPP发送邮件时出错

Php 使用XAMPP发送邮件时出错,php,xampp,Php,Xampp,嗨,我一直在出错 Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in C:\xampp\htdocs\ 我将php.ini中的sendmail更改为: sendmail_from=12343OHBS@gmail.com $to='12343OHBS@gmail.com';//assigns the email address to t

嗨,我一直在出错

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or 
custom "From:" header missing in C:\xampp\htdocs\
我将php.ini中的sendmail更改为: sendmail_from=12343OHBS@gmail.com

  $to='12343OHBS@gmail.com';//assigns the email address to the reciever part of the script
$subject='User Comments OHBS.com';
$header='test';
$name=($_POST['Name']);
$email=($_POST['Email']);
$Question=($_POST['MessageTitle']);
// the mail, the .= function is used to add more elements to the message array
$message="Name: $name\n\n";
$message.="Email: $email\n\n";
$message.="Comment or Question: $Question";
//Wordwrap to limit each line to 100 characters
$message=wordwrap($message, 100);
//Script to send the mail
$mailSent=mail($to,$header,$subject,$message);

请帮忙

确保在xampp中配置了stmp服务器并正在运行。 尝试将sendmail_from值括在引号中


sendmail_from=from@example.com

您是否安装了包含邮件服务器的大型XAMPP软件包?如果没有邮件服务器,当您尝试发送电子邮件时,您的XAMPP安装将始终产生错误。这是正确的,必须有邮件服务器来发送电子邮件。您确定$header='test'不是您的问题吗?