Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAIL_DRIVER=smtp
- MAIL_HOST=smtp.gmail.com
- MAIL_PORT=587
- MAIL_USERNAME=meuemail@gmail.com
- MAIL_PASSWORD=minhasenha
- MAIL_ENCRYPTION=null
- 'driver' => env('MAIL_DRIVER', 'smtp'),
- 'host' => env('MAIL_HOST', 'smtp.gmail.com'),
- 'port' => env('MAIL_PORT'),
- 'from' => ['address' => 'myemail@gmail.com', 'name' => 'Do not Reply'],
- 'encryption' => env('MAIL_ENCRYPTION'),
- 'username' => env('MAIL_USERNAME'),
- 'password' => env('MAIL_PASSWORD'),
- 'sendmail' => '/usr/sbin/sendmail -bs',
- 'to' => [
- 'address' => 'meuemail@gmail.com',
- 'name' => 'Novo Email'
- ],
- class ContactForm extends ComponentBase
- {
- public function componentDetails(){
- return [
- 'name' => 'Contact Form',
- 'description' => 'Simple contact form'
- ];
- }
- public function onSend(){
- $vars = ['name' => Input::get('name'), 'email' => Input::get('email'), 'content' => Input::get('content'), 'phone' => Input::get('phone')];
- try {
- Mail::send('watchlearn.contact::mail.message', $vars, function($message) {
- $message->to('meuemail@gmail.com', 'Admin Person');
- $message->subject('New message from contact form');
- });
- } catch (Throwable $e) {
- var_dump($e->getMessage());
- }
- }
- }
Add Comment
Please, Sign In to add comment