laravel ошибка контактной формы Swift_TransportException - PullRequest
0 голосов
/ 13 июля 2020

Я внес изменения в Laravel (страница контактов) на локальном компьютере, что вызвало ошибку
Кроме того, запрос сохраняется в базе данных хранилища без каких-либо проблем
Ошибка:

Swift_TransportException
Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required
 "

App-> control. php:

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Contact extends Model
{
public $table = 'contact';
public $fillable = ['name','name2','email','subject','note'];
}

app-> http-> controllers-> ContactController. php:
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Contact extends Model
{
public $table = 'contact';
public $fillable = ['name','name2','email','subject','note'];
}

resources-> view-> fronted- > contact.blade. php:
                                <form method="post" class="contact-validation-active" id="contact.store">
                                    {{ csrf_field() }}
                                    <div>
                                        <input type="text" class="form-control" name="name" id="name" placeholder="First Name">
                                    </div>
                                    <div>
                                        <input type="text" class="form-control" name="name2" id="name2" placeholder="Last Name">
                                    </div>
                                    <div class="clearfix">
                                        <input type="email" class="form-control" name="email" id="email" placeholder="Email">
                                    </div>
                                    <div>
                                        <input type="text" class="form-control" name="subject" id="subject" placeholder="Subject">
                                    </div>
                                    <div>
                                        <textarea class="form-control" name="note"  id="note" placeholder="Case Description..."></textarea>
                                    </div>
                                    <div>
                                        <input type="hidden" name="recaptcha" id="recaptcha">
                                    </div>
                                    <div class="submit-area">
                                        <button type="submit" class="theme-btn submit-btn">Send Message</button>
                                        <div id="loader">
                                            <i class="ti-reload"></i>
                                        </div>
                                    </div>
                                    <div class="clearfix error-handling-messages">
                                        <div id="success">Thank you</div>
                                        <div id="error"> Error occurred while sending email. Please try again later. </div>
                                    </div>
                                </form>

resources-> view-> fronted-> email.blade. php:
You received a message from : {{ $name }}

<p>
Name: {{ $name }}
</p>
<p>
First Last name: {{ $name2 }}
</p>
<p>
Subject: {{ $subject }}
</p>

<p>
Email: {{ $email }}
</p>

<p>
Message: {{ $user_message }}
</p>

routes-> web. php:
Route::get('contact', 'ContactController@contact');
Route::post('contact', ['as'=>'contact.store','uses'=>'ContactController@contactPost']);

.nav:
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=m******@gmail.com
MAIL_PASSWORD=*********
MAIL_ENCRYPTION=465
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME="${APP_NAME}"

1 Ответ

0 голосов
/ 13 июля 2020

У вас MAIL_ENCRYPTION = 465, вы хотите установить его на:

MAIL_ENCRYPTION=ssl
...