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

preview_player
Показать описание
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
THANK YOU!

🛠️ TOOLS & SERVICES I USE

COURSE PLAYLIST

RESOURCES

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
Рекомендации по теме
Комментарии
Автор

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!


megyptmEgy
Автор

Came here due to Youtube'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!

cpanagoulias
Автор

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.

hansschuijff
Автор

best php tutorial I've seen ever.

hannanmiah
Автор

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 👍👍👍

aleksandrkanygin
Автор

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.

Zubbee
Автор

Great as usually. You simply read my mind (mailhog) 😃.

constantinci
Автор

Clear and solid explanation for Emailer Package

edwardai
Автор

Amazing tutorial. Very detailed and knowledgeable. Thank you very much!

martin
Автор

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.

truthteachers
Автор

Yeah ok but how to implement this mailer to a HTML <form> website? You start here 2:46 with a PHP document. Where is this from and what to do with this PHP document?

khancross
Автор

w0w we simply swap mailer to our custom mailer as an example of implementing an interface or implementation, splendid

stephen.cabreros
Автор

Very nice! Do you leave the dsn in production empty? Or to null

devanii
Автор

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.

expresscoding
Автор

I am a little lost how can we access the config variable without using this keyword and since when is this function is available

DigitaSkills
Автор

Hello sir, please what about sending emails with Google? How does it work?

liym-ntairaylangdji
Автор

ძაან გთხოვ,
შეგიძლია გააკეთო ეს ვიდეო contact form -ით?
ანუ კლიენტი წერს თავის იმეილს სახელს ტექსტს და ეს მისდის საიტის მფლობელს მეილზე

ნოდარდავითულიანი
Автор

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 😟😟

nooralmoswy
Автор

Hey Gio, I try to send emails using mailhog but I get this error "Uncaught 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 Please what could be the solution?

AlexDolon
Автор

This lesson will keep me busy for a while :-) Great great stuff Gio!

First of possibly many questions:
in the Symfony package @ 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?

lairotuT-Tutorial
visit shbcf.ru