Hello in this video we are going to take a look at sending email attachments using PHP mailer. So email attachments really simple. If you've watched the regular email attachments video, you will see the difference straightaway. With that one yes do so many long code and the so easy to make mistake. This is one reason you'd use something like PHP mailer, just hand all that in the background and do the even a lot more efficient than the way we would usually do. Okay, so you this can be an HTML email or a regular email that doesn't matter to add attachments to dollar mail and attachment.
And this is the function first parameter that it takes is the location of the file. And in my case, it is literally in the same place But if he was to say in other no folder for slash, then the name of the file you that's that sort of structure you would go for Domain Dot PDF with a lowercase D, I believe. Yeah. And then what you can do is rename it as also compare a comma and rename this so let's rename it to Epic dot PDF. And we need to do now that's literally all we need to do to either that attachment. If you haven't checked that the email attachments video, just as a quick comparison, just have a look at go through the video and just see the difference that PHP mailer makes for reload that way for the email to be received.
There we go. You got the mail, but they it's been renamed as we wanted to, to Epic dot PDF. So that is how you add it. attachments are a lot simpler than doing it manually handling all of the MIME, no version, the boundary and all of that stuff that just was just so awkward to do that. That's it any questions? Feel free to pop me a message and as usual, I look forward to seeing you in the next video.