"Expected response code "250" but got code "550", with message "550-Sorry! This server is unable to send email from this domain: 550 gmail.com. Please try sending from a domain on this server."
MAIL_DRIVER=smtp
MAIL_HOST=mail.domain.com
MAIL_PORT=465
MAIL_USERNAME=me@domain.com
MAIL_PASSWORD=......
MAIL_ENCRYPTION=ssl
Controller:
Namespace App\Http\Controllers;
use App\Notifications\ContactFormMessage;
use App\Http\Controllers\Controller;
use App\Http\Requests\ContactFormRequest;
use App\Recipient;
Class ContactController extends Controller
{
public function show()
{
return view('contact.index');
}
public function mailContactForm(ContactFormRequest $message, Recipient $recipient)
{
$recipient->notify(new ContactFormMessage($message));
return redirect()->back()->with('message', 'Thanks for your message! We will get back to you soon!');
}
}
Model recipient
namespace App;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\Model;
class Recipient extends Model
{
use Notifiable;
protected $recipient;
protected $email;
public function __construct() {
$this->recipient = config('recipient.name');
$this->email = config('recipient.email');
}
}
Checked email settings and password. ran composer dump-autoload