Thank you so much for the amazing PHP courses you share online! Your tutorials have been a game-changer for me, and I can't express how much I’ve learned from your clear and practical explanations. Your passion for teaching and your ability to simplify complex concepts have inspired me to keep growing as a developer. I'm so grateful for all the effort and dedication you put into helping people like me learn and improve. Keep up the fantastic work-you’re making a real difference in the lives of so many aspiring developers!
Came here due to TH-cam'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!
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.
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 👍👍👍
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
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?
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.
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.
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.
@@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).
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.
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 👍
@@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 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"
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 😟😟
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.
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?
This lesson will keep me busy for a while :-) Great great stuff Gio! First of possibly many questions: in the Symfony package @ Symfony\Component\Mime\Message.php I can see inside the constructor: $this->headers = $headers ? clone $headers : new Headers(); You mentioned cloning in some lessons before but I am not really understanding why in case of an Email we should clone this object instead of just passing it through? $this->headers = $headers ? $headers : new Headers(); At least I would (if really needed, clone the headers object one layer above and in addition would get rid of the nullable Headers... that makes no sense imo as we create the object if it is not existing ergo: We will obviously always need it. public function __construct( private Headers $headers, private ?AbstractPart $body = null, ) {} Would you agree?
I'm sure Symfony developers had a reason for it. Cloning means that changes to the properties of the headers variable wont have effect on the object outside of the Message class. So if you had headers object outside of Message class & you passed it down and the Message did not clone it, when Message class makes changes to properties of the Headers object, it would affect the outer scope as well & that may not always be desired. So cloning it ensures that modifications to headers object only affects the Message class & nothing else outside of it
@@ProgramWithGio Well, I kept the cloning but as mentioned moved it upwards and got rid of the nullable to force error in case it should ever be null. Thanks again for your incredible high effort in answering each and every post! You are just the GOAT!
Thank you so much for the amazing PHP courses you share online! Your tutorials have been a game-changer for me, and I can't express how much I’ve learned from your clear and practical explanations.
Your passion for teaching and your ability to simplify complex concepts have inspired me to keep growing as a developer. I'm so grateful for all the effort and dedication you put into helping people like me learn and improve.
Keep up the fantastic work-you’re making a real difference in the lives of so many aspiring developers!
Thank you for kind words, appreciate it 💙💙
Came here due to TH-cam'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!
That's awesome, thank you so much 🙏 💙
best php tutorial I've seen ever.
Thank you 🙌
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.
Happy to hear Hans, thank you 🙌
Great as usually. You simply read my mind (mailhog) 😃.
Thank you. Glad it was useful 🙌
Clear and solid explanation for Emailer Package
Glad you like it 🙌. Thank you
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.
Great to hear 💙
Amazing tutorial. Very detailed and knowledgeable. Thank you very much!
Happy to hear that, thank you 🙌
Great as usually.
Thank you
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 👍👍👍
That's so awesome, thank you 💙💙
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
Thanks for the good content
You're welcome
Great Gio Back welcome back master
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?
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.
@@ProgramWithGio Is it enough to upload this PHP form and make ?
w0w we simply swap mailer to our custom mailer as an example of implementing an interface or implementation, splendid
Glad you like it, thank you
Thank you.
💙
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.
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.
@@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).
@@ProgramWithGio Just an update. I tested using the symfony and phpmailer libraries. Both worked fine with my vps email server. Thank you.
Do you plan to more laravel courses?
Yes after we finish the PHP series
Very nice! Do you leave the dsn in production empty? Or to null
Thank you. No in production that would be filled in.
@@ProgramWithGio ah but with the user and pass filled in
@@devanii yup
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.
at 12:54 when you started refactoring ?
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
I am a little lost how can we access the config variable without using this keyword and since when is this function is available
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 👍
@@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 👍
@@DigitaSkills101 awesome, no problem at all. Thanks 🙏
Hello sir, please what about sending emails with Google? How does it work?
Not sure what you mean
@@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"
Modern PHP Bible
Thank you 🙌
ძაან გთხოვ,
შეგიძლია გააკეთო ეს ვიდეო contact form -ით?
ანუ კლიენტი წერს თავის იმეილს სახელს ტექსტს და ეს მისდის საიტის მფლობელს მეილზე
ვეცდები, მადლობა რჩევისთვის.
@@ProgramWithGio არაფრის. ძალიან დამეხმარებოდა ეგ ვიდეო
ხომ არ მოგიფიქრებია ჩაწერა? დდ
@@ნოდარდავითულიანი არა. ალბათ კურსის ბოლოსკენ თუ გამოვნახე თავისუფალი დრო. ეხლა დრო არ მაქვს და ბევრი სხვა ვიდეო მაქვს ჩასაწერი.
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 😟😟
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.
Phpmailer vs symfony mailer
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
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?
make sure mailhog container is running
This lesson will keep me busy for a while :-) Great great stuff Gio!
First of possibly many questions:
in the Symfony package @ Symfony\Component\Mime\Message.php I can see inside the constructor:
$this->headers = $headers ? clone $headers : new Headers();
You mentioned cloning in some lessons before but I am not really understanding why in case of an Email we should clone this object instead of just passing it through?
$this->headers = $headers ? $headers : new Headers();
At least I would (if really needed, clone the headers object one layer above and in addition would get rid of the nullable Headers... that makes no sense imo as we create the object if it is not existing ergo: We will obviously always need it.
public function __construct(
private Headers $headers,
private ?AbstractPart $body = null,
) {}
Would you agree?
I'm sure Symfony developers had a reason for it. Cloning means that changes to the properties of the headers variable wont have effect on the object outside of the Message class. So if you had headers object outside of Message class & you passed it down and the Message did not clone it, when Message class makes changes to properties of the Headers object, it would affect the outer scope as well & that may not always be desired. So cloning it ensures that modifications to headers object only affects the Message class & nothing else outside of it
@@ProgramWithGio Well, I kept the cloning but as mentioned moved it upwards and got rid of the nullable to force error in case it should ever be null.
Thanks again for your incredible high effort in answering each and every post! You are just the GOAT!