我正在尝试通过 Laravel 发送电子邮件。但它越来越错误。
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemailID@gmail.com
MAIL_PASSWORD=******
MAIL_ENCRYPTION=tls
Run Code Online (Sandbox Code Playgroud)
$data = array('name'=>"Ripon Uddin", "body" => "Test mail");
Mail::send('email', $data, function($message) {
$message->to('ToEmailID@yahoo.com','To My Yahoo')->subject('Laravel Test Email');
$message->from('ToFromID@gmail.com','Ripon Uddin (Laravel Lover)');
});
Run Code Online (Sandbox Code Playgroud)
错误获取:
无法使用 3 个可能的身份验证器使用用户名“myEmailID@gmail.com”在 SMTP 服务器上进行身份验证。身份验证器登录返回 Swift_TransportException:预期响应代码 235,但得到代码“535”,消息“535-5.7.8 用户名和密码不被接受。在 535 5.7.8 https://support.google.com/mail/了解更多信息? p=BadCredentials r18-v6sm7406256pgv.17 - gsmtp " in
我尝试迁移项目的购买表
当我尝试迁移时,它显示表空间错误。
一般错误:1813 表 ' 的表空间
jshop。purchases' 存在。请在导入之前丢弃表空间。
迁移代码如下:
Schema::create('purchases', function (Blueprint $table) {
$table->increments('id');
$table->integer("product_price");
$table->integer("product_qty");
$table->unsignedInteger('invoice_id');
$table->unsignedInteger('product_id');
$table->unsignedInteger('weight_id');
$table->timestamps();
$table->foreign("invoice_id")->references('id')->on('invoices');
$table->foreign("product_id")->references('id')->on('products');
$table->foreign("weight_id")->references('id')->on('weights');
});
Run Code Online (Sandbox Code Playgroud)
错误消息图片如下: 迁移错误图片链接 如何解决此问题?