Having a contact form where a user can submit their contact request is a very common thing in today’s modern websites. Follow along as we add a contact form and use a Mailable to send an email.

For the best experience, follow along in our interactive school at

Resources
Course Source Code

Hit us up on Twitter with any questions or comments @codertape (

About This Course

Ready to get started on your path to Laravel Artisan? In this series, we are breaking down all of the basics of Laravel to get you comfortable using the world’s most popular PHP framework. Let’s get started!

Nguồn: https://dorifaucet.com/

Xem thêm bài viết khác: https://dorifaucet.com/cong-nghe/

46 Comments

  • Maurizio Calarese
    Posted July 12, 2020 7:06 pm

    Could you please share the code along the videos?

  • Electronic Proton
    Posted July 12, 2020 7:06 pm

    For the newer version of Laravel you will need to delete this in your .env file MAIL_FROM_ADDRESS=null to avoid getting the error Swift_TransportExceptionCannot send message without a sender address. The other option is to give it a value like MAIL_FROM_ADDRESS=myfirstproject@laravel.com and it will also work. Good luck!

  • Beatrix Ducz
    Posted July 12, 2020 7:06 pm

    The small letters of the PHPStorm IDE are hard to see. Sometimes it's hard to get which file you're working on, can't read the file name properly, however I use a normal screen. For the future. Thanks. 🙂 Do you have a podcast or sg?

  • Anuoluwapo David
    Posted July 12, 2020 7:06 pm

    What does trying to access array offset on value of type null means

  • Mustafa Taeb
    Posted July 12, 2020 7:06 pm

    How to solve this error
    "Swift_TransportException

    Cannot send message without a sender address"

  • Cedric Labrador
    Posted July 12, 2020 7:06 pm

    Cannot send message without a sender address << I'm getting this error

  • Haseeb Hussain
    Posted July 12, 2020 7:06 pm

    awesome video so helpful

  • Shashwat Singh
    Posted July 12, 2020 7:06 pm

    Can you do a Laravel Contract tutorial? All the other tutorials are in a language other than English.

  • ilyes el jawhari
    Posted July 12, 2020 7:06 pm

    plz i need a help when i send message i get an error :
    Cannot send message without a sender address

  • Bruno Moyse
    Posted July 12, 2020 7:06 pm

    Thank you so much, it's been really helpful !

  • Delvin Duel
    Posted July 12, 2020 7:06 pm

    when I try to send mail I get this error over and over .. "Cannot send message without a sender address " .
    I set up all correctly and (using mailtrap) I am using Laravel 7.0.2 . If you dont mind can you figure it out for me.. Thank You.

  • onyango ishmail
    Posted July 12, 2020 7:06 pm

    thanks alot it worked for me

  • Gagan Bhujel
    Posted July 12, 2020 7:06 pm

    The message are only shown in mail trap not in our gmail..

  • PutraIB LIVE
    Posted July 12, 2020 7:06 pm

    i have problem :

    Swift_TransportException

    Cannot send message without a sender address

    pls help me

  • Dina Essam
    Posted July 12, 2020 7:06 pm

    i have this error
    i restarted my server and no result
    Swift_TransportException

    Cannot send message without a sender address

  • Sammy Sosa
    Posted July 12, 2020 7:06 pm

    i still cant believe these lessons are free

  • Anirban Roy
    Posted July 12, 2020 7:06 pm

    you have a voice of tony stark

  • Alan Rodriguez
    Posted July 12, 2020 7:06 pm

    Great video but how can I receive the message at my email, for example info@mydomain.com ???

  • mos saad
    Posted July 12, 2020 7:06 pm

    i had a problem when sending mail "Cannot send message without a sender address" any help please

  • Robby Alvian Jaya Mulia
    Posted July 12, 2020 7:06 pm

    How to do auto import class like phpstorm but using Visual Studio Code?

  • Ayaz Amin
    Posted July 12, 2020 7:06 pm

    please make a video on how to take database backups within laravel app. right from withing a laravel app on button click.

  • Bibek Shrestha
    Posted July 12, 2020 7:06 pm

    it worked on local host but gets error when i upload it to server plz help …

  • Raul Alfonzo
    Posted July 12, 2020 7:06 pm

    Awesome video man. Quite question over here, tho.

    Will I receive an actual Email at the 'test@test.com' email if I changed it for a real email?

    Cause I tried and I don't. I keep receiving it only on mailtrap.

  • Jagtar Singh
    Posted July 12, 2020 7:06 pm

    help Driver [smtp.smtp] not supported. ………for email sendind

  • Jagtar Singh
    Posted July 12, 2020 7:06 pm

    Driver [smtp.smtp] not supported.

  • Rabbi Mahmud
    Posted July 12, 2020 7:06 pm

    sir when i am submitting the contact form i am getting the same page and my mail box is showing empty..can you please give me the solution

  • Mohamed Ilham
    Posted July 12, 2020 7:06 pm

    Text input fields like name and email are working fine for me. However, when it comes to a dropdown list, how can I get the selected value to my mailtrap inbox? Any help would me much appreciated.

  • Roman Simonenko
    Posted July 12, 2020 7:06 pm

    Bravo!

  • Dragon Jqrako
    Posted July 12, 2020 7:06 pm

    My contact form isnt working because when i my website i get a error with contact.create is not here

  • Yong Yee AhSoh
    Posted July 12, 2020 7:06 pm

    it works. thank you to teach how to send email.

  • distantstarrr
    Posted July 12, 2020 7:06 pm

    Upon clicking Send Message, got Laravel error: "Swift_TransportException (530) Expected response code 250 but got code "530", with message "530 5.7.1 Authentication required"

    I doubled checked that i had everything setup correctly, like Victor showed, in the video, and all was correct for me. Only after doing an online search, found this at stackoverflow (https://stackoverflow.com/questions/48341078/expected-response-code-250-but-got-code-530-with-message-530-5-7-1-authentic ): run 'php artisan config:cache'. This command worked for me. I was now able to send the email to mailtrap.io

  • Sven Budak
    Posted July 12, 2020 7:06 pm

    Awesome tutorial! But can you please show us how we can clear on submit the inputs and show a notification that tells the user that the form successfull has been submitted WITHOUT reloading the site? (jQuery or vueJS)

  • Ayman Mohamed
    Posted July 12, 2020 7:06 pm

    Great tutorial,
    There's a browser extension called "form filler" it's very helpful to fill any inputs with dummy data it also fills the inputs according to their type (email, password, etc..) it will save you a lot of time in general when testing forms.

  • Lily Ben
    Posted July 12, 2020 7:06 pm

    Thanks a lot!

  • Mike gallager
    Posted July 12, 2020 7:06 pm

    The best Tutorial

  • Joben Apao
    Posted July 12, 2020 7:06 pm

    when I received the message thru mailtrap. it literally shows <strong>Name</strong> instead of that bold font.

  • Aidenraadh
    Posted July 12, 2020 7:06 pm

    You saved my life sir, great tutorial

  • Denny A.S. Sandehang
    Posted July 12, 2020 7:06 pm

    how do we know if the email is sent sucessfully or failed?

  • Aamish Irfan
    Posted July 12, 2020 7:06 pm

    include(C:UsersaamislaravelProjectsBasic): failed to open stream: Permission denied

    help me out with this plzz

  • Tomasz Ek
    Posted July 12, 2020 7:06 pm

    stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed

  • Reza
    Posted July 12, 2020 7:06 pm

    Thanks Victor. Any reason to use Markdown over a Blade template?

    For other viewers: Note that you can specify the "from" field in your Mailable class:

    return $this->from('example@example.com')

    ->view('emails.orders.shipped');

    And you can add CC and BCC fileds in the controller:

    Mail::to($request->user())

    ->cc($moreUsers)

    ->bcc($evenMoreUsers)

    ->send(new OrderShipped($order));

    Check here: https://laravel.com/docs/5.8/mail

  • noelkalel
    Posted July 12, 2020 7:06 pm

    hi there 🙂

    how would u set up env file for production purposes?

  • Alvaro Mallo
    Posted July 12, 2020 7:06 pm

    At minute 17:19 and hit refresh it sends me this: Array to string conversion.

  • Silas Selekane
    Posted July 12, 2020 7:06 pm

    Thanks for tutorial

  • Innoox
    Posted July 12, 2020 7:06 pm

    Okay, so if someone has the error with sending mail first time, try this one:
    php artisan config:cache

    php artisan cache:clear

    php artisan config:clear

    and then restart the server
    php artisan serve

  • Rak Usu
    Posted July 12, 2020 7:06 pm

    What's taking him a long time to use route() rather than hardcoding them? Been watching 19 episodes and I'm quite bothered that beginners has to watch that long and still not learn such a basic tip.

Leave a comment