Laravel mail error: Process could not be started [The system cannot find the path specified. ]
Laravel mail error: Process could not be started [The system cannot find the path specified. ]
我正在开发一个新的 Laravel 应用程序。当我使用邮件通过我网站上的联系表单发送消息时,出现以下错误:
Process could not be started [The system cannot find the path specified. ]
我正在我的本地环境中开发,但使用我的企业邮件来接收消息。
我的控制器:
namespace App\Http\Controllers;
use App\SendMessage;
use App\Mail\SendEmail;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use App\Http\Controllers\Controller;
use Session;
class SendMessageController extends Controller
{
public function store(Request $request) {
$this->validate($request, [
"email" => "required|email",
"message" => "min:10",
"subject" => "min:3"
]);
$name = $request->name;
$email = $request->email;
$company = $request->company;
$subject = $request->subject;
$message = $request->message;
Mail::to("audit@auditors.uz")->send(new SendEmail($subject, $message));
Session::flash("success", "Your email was sent");
return back();
}
}
?>
我的邮件功能:
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class SendEmail extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public $sub;
public $mese;
public function __construct($subject, $message)
{
$this->sub = $subject;
$this->mes = $message;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$e_subject = $this->sub;
$e_message = $this->mes;
return $this->view('emails.contact', compact("e_message"))->subject($e_subject);
}
}
?>
我的 .env
文件:
MAIL_DRIVER=mail
MAIL_HOST=mail.auditors.uz
MAIL_PORT=465
MAIL_USERNAME=audit@auditors.uz
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
我用谷歌搜索了很多,但没有找到合适的答案。如果你们中有人能帮助我,我会很高兴。因为我一直在寻找解决方案。
您的 MAIL_DRIVER
设置为 mail
,默认情况下不存在。如果您使用的是 SMTP 邮件服务器,则应使用 smtp
作为驱动程序。
请确保您的电子邮件提供商支持端口 465 和 TLS 加密。不过,大多数提供商会自动支持这些。
我正在开发一个新的 Laravel 应用程序。当我使用邮件通过我网站上的联系表单发送消息时,出现以下错误:
Process could not be started [The system cannot find the path specified. ]
我正在我的本地环境中开发,但使用我的企业邮件来接收消息。
我的控制器:
namespace App\Http\Controllers;
use App\SendMessage;
use App\Mail\SendEmail;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use App\Http\Controllers\Controller;
use Session;
class SendMessageController extends Controller
{
public function store(Request $request) {
$this->validate($request, [
"email" => "required|email",
"message" => "min:10",
"subject" => "min:3"
]);
$name = $request->name;
$email = $request->email;
$company = $request->company;
$subject = $request->subject;
$message = $request->message;
Mail::to("audit@auditors.uz")->send(new SendEmail($subject, $message));
Session::flash("success", "Your email was sent");
return back();
}
}
?>
我的邮件功能:
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class SendEmail extends Mailable
{
use Queueable, SerializesModels;
/**
* Create a new message instance.
*
* @return void
*/
public $sub;
public $mese;
public function __construct($subject, $message)
{
$this->sub = $subject;
$this->mes = $message;
}
/**
* Build the message.
*
* @return $this
*/
public function build()
{
$e_subject = $this->sub;
$e_message = $this->mes;
return $this->view('emails.contact', compact("e_message"))->subject($e_subject);
}
}
?>
我的 .env
文件:
MAIL_DRIVER=mail
MAIL_HOST=mail.auditors.uz
MAIL_PORT=465
MAIL_USERNAME=audit@auditors.uz
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
我用谷歌搜索了很多,但没有找到合适的答案。如果你们中有人能帮助我,我会很高兴。因为我一直在寻找解决方案。
您的 MAIL_DRIVER
设置为 mail
,默认情况下不存在。如果您使用的是 SMTP 邮件服务器,则应使用 smtp
作为驱动程序。
请确保您的电子邮件提供商支持端口 465 和 TLS 加密。不过,大多数提供商会自动支持这些。