Тёмный
No video :(

How to Send Email in PHP - Symfony Mailer - Email Protocols - Mailhog Setup - Full PHP 8 Tutorial 

Program With Gio
Подписаться 53 тыс.
Просмотров 24 тыс.
50% 1

In this lesson, we learn how to send emails in PHP using the Symfony Mailer package. We also learn the basics of email protocols like SMTP, POP3 & IMAP as well as how to set up a local mailbox to test emails using Mailhog.
SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
⭐ Become a Patreon: / programwithgio
THANK YOU!
🛠️ TOOLS & SERVICES I USE
Digital Ocean Hosting - Get 100$ credit - m.do.co/c/38b9...
Domains on Namecheap - namecheap.pxf....
Envato Elements - 1.envato.marke...
Adobe Photoshop & Premiere - clk.tradedoubl...
COURSE PLAYLIST
• Learn PHP The Right Wa...
RESOURCES
Symfony Mailer - symfony.com/do...
Source Repo - github.com/gge...
Lesson 3.3 Dependency Injection - • Dependency Injection &...
Lesson 3.4 Dependency Injection Containers - • Dependency Injection &...
Lesson 3.5 Dependency Injection With Interfaces - • DI Container With Inte...
** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.

Опубликовано:

 

21 фев 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 66   
@cpanagoulias
@cpanagoulias 2 года назад
Came here due to RU-vid's algorithm, stayed for the content. Even for stuff I thought I had a good grasp on, there are always valuable gems inside every video that make me go "What? You can do this?"! I can't thank you enough for the good work and awesome way of presenting the material. Keep up the excellent work Gio! Please don't stop. We need more! Thanks again!
@ProgramWithGio
@ProgramWithGio 2 года назад
That's awesome, thank you so much 🙏 💙
@hansschuijff
@hansschuijff Год назад
Great lesson again. I like that you teach as much about the php language, as oop design concepts and how to setup a working dev environment and use populair packages. A great start for anyone that wants to step into modern code practices. Thanks, Gio. Learning a lot from you.
@ProgramWithGio
@ProgramWithGio Год назад
Happy to hear Hans, thank you 🙌
@hannanmiah1240
@hannanmiah1240 2 года назад
best php tutorial I've seen ever.
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 🙌
@aleksandrkanygin2672
@aleksandrkanygin2672 2 года назад
Awesome, watching your course i improved not only my php skills specifically, but coding overall. I see a lot of improvements in my JS code after watching your course to this point. Thank you 👍👍👍
@ProgramWithGio
@ProgramWithGio 2 года назад
That's so awesome, thank you 💙💙
@Jam-ht2ky
@Jam-ht2ky Год назад
totally agree. The firm i work in used to be PHP mainly but they switched to JavaScript because of performance reasons but they brought a lot of practises of PHP to javascript and studying this series helped me become better with both
@constantinci
@constantinci 2 года назад
Great as usually. You simply read my mind (mailhog) 😃.
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you. Glad it was useful 🙌
@vickybabe1420
@vickybabe1420 Год назад
Gio!! Thanks for sharing your smart brain with us. 😊
@ProgramWithGio
@ProgramWithGio Год назад
Heyy 👋 😊
@Zubbee
@Zubbee 2 года назад
Wow. This is all new to me. I followed and practiced as well. It's great to see how some of these things work. Thanks Gio. I'm fired up to move on.
@ProgramWithGio
@ProgramWithGio 2 года назад
Great to hear 💙
@sergeykonov4562
@sergeykonov4562 6 месяцев назад
Great as usually.
@ProgramWithGio
@ProgramWithGio 6 месяцев назад
Thank you
@martin2126
@martin2126 Год назад
Amazing tutorial. Very detailed and knowledgeable. Thank you very much!
@ProgramWithGio
@ProgramWithGio Год назад
Happy to hear that, thank you 🙌
@edwardai209
@edwardai209 2 года назад
Clear and solid explanation for Emailer Package
@ProgramWithGio
@ProgramWithGio 2 года назад
Glad you like it 🙌. Thank you
@stephen.cabreros
@stephen.cabreros 11 месяцев назад
w0w we simply swap mailer to our custom mailer as an example of implementing an interface or implementation, splendid
@ProgramWithGio
@ProgramWithGio 11 месяцев назад
Glad you like it, thank you
@hsemix
@hsemix 2 года назад
Thanks for the good content
@ProgramWithGio
@ProgramWithGio 2 года назад
You're welcome
@khancross
@khancross Год назад
Yeah ok but how to implement this mailer to a HTML website? You start here 2:46 with a PHP document. Where is this from and what to do with this PHP document?
@ProgramWithGio
@ProgramWithGio Год назад
There is a link to the source repo in the description. HTML part is done off the recording, it's just a form with post request to the register route, nothing fancy.
@khancross
@khancross Год назад
@@ProgramWithGio Is it enough to upload this PHP form and make ?
@memack101
@memack101 2 года назад
Thank you.
@ProgramWithGio
@ProgramWithGio 2 года назад
💙
@expresscoding3525
@expresscoding3525 9 месяцев назад
Hello sir, I've a question, you removed this line of code: $mailer = new Mailer($transport); from UserController while refactoring at near the end of the lesson, but it still works, how is that possible, please explain it sir.
@expresscoding3525
@expresscoding3525 9 месяцев назад
at 12:54 when you started refactoring ?
@ProgramWithGio
@ProgramWithGio 9 месяцев назад
We are injecting that as a dependency in the constructor, keep watching & you will see that we add the custom mailer class & bind it in the container
@liym-ntairaylangdji3441
@liym-ntairaylangdji3441 6 месяцев назад
Hello sir, please what about sending emails with Google? How does it work?
@ProgramWithGio
@ProgramWithGio 5 месяцев назад
Not sure what you mean
@liym-ntairaylangdji3441
@liym-ntairaylangdji3441 5 месяцев назад
@@ProgramWithGio what I actually meant was how I could send emails using gmail smtp beacause I tried with mailhog but I got this error "Uncaught Symfony\Component\Mailer\Exception\TransportException: Connection could not be established with host "mailhog:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailhog failed: Temporary failure in name resolution in /var/www/html/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:154"
@devanii
@devanii 2 года назад
Very nice! Do you leave the dsn in production empty? Or to null
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you. No in production that would be filled in.
@devanii
@devanii 2 года назад
@@ProgramWithGio ah but with the user and pass filled in
@ProgramWithGio
@ProgramWithGio 2 года назад
@@devanii yup
@truthteachers
@truthteachers Год назад
Bro, I need help really bad. (1) You installed MailHog using docker and some of us are not using docker (2) at timestamp 8:35, your video is not showing the use classes and when tried to import the class, my script imports classes which i assume to be correct (3) The is view for "users/register" which is not mentioned in the video. To resolve (1) I setup my email account in my own shared vps host but do not where to include the user password.
@ProgramWithGio
@ProgramWithGio Год назад
The source is in the repo, link in description. So you can compare the use statements, not everything can be visible in the videos at all times. The view file is just a simple HTML also part of the source. As for mailhog it can be installed on windows without Docker as well. You can do a bit of googling to find instructions how to set it up without Docker. There is executable file you can download github.com/mailhog/MailHog/releases You don't have to use mailhog, you can also just create mailtrap account for example or use any other SMTP service/account, just configure the credentials properly. You can check the Symfony mailer docs for exact options. Watch from 6:15 I explain DSN so you'll just have to replace it with your credentials, username, password, host, port.
@truthteachers
@truthteachers Год назад
@@ProgramWithGio The repo is end product for the video. The use statements do not seem to match those that are imported as we progress. I decided to drop mailhog which seems to be way outdated (2020) for Windows. I will use my vps email server. I am also testing with PHPMailer which simpler to use then symfony/mailer (very complicated).
@truthteachers
@truthteachers Год назад
@@ProgramWithGio Just an update. I tested using the symfony and phpmailer libraries. Both worked fine with my vps email server. Thank you.
@DigitaSkills101
@DigitaSkills101 2 года назад
I am a little lost how can we access the config variable without using this keyword and since when is this function is available
@ProgramWithGio
@ProgramWithGio 2 года назад
Hey, are you referring to the Config class or the $_ENV super global? We covered both of them in the series. If you are referring to accessing array properties on Config class that's done via magic getter method (also covered in the series). Please include the timestamp for the part that's confusing and I'll be happy to clarify it further 👍
@DigitaSkills101
@DigitaSkills101 2 года назад
@@ProgramWithGio Sorry for the trouble but the problem is solved , I didn't know that we could access class properties without the "$this" keyword in the magic __construct function. Your tutorial helped me know that. Thanks 👍
@ProgramWithGio
@ProgramWithGio 2 года назад
@@DigitaSkills101 awesome, no problem at all. Thanks 🙏
@mateuszb4387
@mateuszb4387 2 года назад
Modern PHP Bible
@ProgramWithGio
@ProgramWithGio 2 года назад
Thank you 🙌
@nooralmoswy7347
@nooralmoswy7347 Год назад
composer : The term 'composer' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. that is what happen when trying composer composer require symfony/mailer 😟😟
@ProgramWithGio
@ProgramWithGio Год назад
My assumption is that you are trying to run composer commands in PowerShell where it's not available. Launch the Linux OS terminal if you are using WSL2 on Windows. Also try googling that error.
@topalek
@topalek Год назад
Do you plan to more laravel courses?
@ProgramWithGio
@ProgramWithGio Год назад
Yes after we finish the PHP series
@belloabdulroufolatunbosun5439
@belloabdulroufolatunbosun5439 2 года назад
Phpmailer vs symfony mailer
@ProgramWithGio
@ProgramWithGio 2 года назад
I haven't used Phpmailer so wouldn't be able to give you a good answer to that but I'm sure it's a good alternative as well
@user-hp4bx3gn6k
@user-hp4bx3gn6k 2 года назад
ძაან გთხოვ, შეგიძლია გააკეთო ეს ვიდეო contact form -ით? ანუ კლიენტი წერს თავის იმეილს სახელს ტექსტს და ეს მისდის საიტის მფლობელს მეილზე
@ProgramWithGio
@ProgramWithGio 2 года назад
ვეცდები, მადლობა რჩევისთვის.
@user-hp4bx3gn6k
@user-hp4bx3gn6k 2 года назад
@@ProgramWithGio არაფრის. ძალიან დამეხმარებოდა ეგ ვიდეო
@user-hp4bx3gn6k
@user-hp4bx3gn6k 2 года назад
ხომ არ მოგიფიქრებია ჩაწერა? დდ
@ProgramWithGio
@ProgramWithGio 2 года назад
@@user-hp4bx3gn6k არა. ალბათ კურსის ბოლოსკენ თუ გამოვნახე თავისუფალი დრო. ეხლა დრო არ მაქვს და ბევრი სხვა ვიდეო მაქვს ჩასაწერი.
@abdallakaram5376
@abdallakaram5376 2 года назад
Great Gio Back welcome back master
@user-qq4nl1oh1f
@user-qq4nl1oh1f 5 месяцев назад
Hey Gio, I try to send emails using mailhog but I get this error "Uncaught Symfony\Component\Mailer\Exception\TransportException: Connection could not be established with host "mailhog:1025": stream_socket_client(): php_network_getaddresses: getaddrinfo for mailhog failed: Temporary failure in name resolution in /var/www/html/vendor/symfony/mailer/Transport/Smtp/Stream/SocketStream.php:154". Please what could be the solution?
@ProgramWithGio
@ProgramWithGio 5 месяцев назад
make sure mailhog container is running
Далее
Turns out REST APIs weren't the answer (and that's OK!)
10:38
I forced EVERYONE to use Linux
22:59
Просмотров 354 тыс.
NGINX Tutorial - What is Nginx
14:32
Просмотров 90 тыс.
No Code App Development is a Trap
9:31
Просмотров 206 тыс.
POP3 vs IMAP - What's the difference?
7:50
Просмотров 1,4 млн
Tmux has forever changed the way I write code.
13:30
Просмотров 960 тыс.
The Logging Everyone Should Be Using in .NET
15:34
Просмотров 57 тыс.