Hello, in this video, I am going to show you how to send a HTML email the plain text email in this sort of format and email yourself pretty basic do HTML email, it's actually really simple. So for the body sprays out a bit, and I'll want to do this in some sort of bold tag. So what we'll want to do is and we're going to put doctype, the doctype, HTML HTML tag. So this is literally the sort of format that you are used to in HTML. And if you want thorough, you know, syntax highlighting and the indentation, I recommend doing the email in a separate file, then just copy and paste it into here and obviously, very few appointments are performed. You can load it as like a website or as a web page, see if it's what you want, and then you know, start saved in there.
You don't want to stop any it uses in real life. It's just totally messed up. Okay, put a head as well. And obviously, you could put like tight or title. And in here we are going to put h1 tag, the head tag and say this is a header in an email. Then we could put a div tag.
And in here we could say epic email. Epic quality, epic body and put metallic tag around. Well, it could be in those steps over. And let's put some styling styling. Before quotation mark, hello, red. There we go.
So this isn't quite ready to send yet doesn't want to turn that we need to make this an HTML email he wants to send it like this. He would just read it, you know, pump this out. Actually what happened if we just send it literally like that? Got one, I think he just literally flimsy as text, which is not what we want at all. So what we actually want is to modify the header. So we'll just you know, create the head of variable here, and we're going to do separate just click easy when you have multiple headers.
You You need to put mine dash version, colon 1.0. And you can just put dots, backslash R, backslash n. And to add a number one, you can just put a dot here which just append this on to this particular header. And then you could put a backslash r backslash n at the end of this one and add another header such as CC and BCC. So now if we reload the page wait for a Okay, so it's still doing the same thing where the actual email isn't being rendered properly. So let's have a look what what's gone wrong. Let's go through from the start.
Okay to look for in subject or find in the body Maybe then the diff possibly though well that would have messed it up air. Canada Hans, he was he you know, the fact is all indented would ever mess it up. It's gonna be something here so headers equals mine dash version colon 1.0 dot four backslash our backslash n, head of forgot one more header. There we go one more header and it is the content type. And this is set to text for slash HTML semi colon, char set equal just the UTF eight standard and then we can just put the question backslash n here. And then if we reload the page there we go advocacy.
We've got the header, we've got the DC tags, and this is a read so that that is how you set up a HTML email. So the three main things, make sure you add these two headers and just HTML for literally all there is to it. So this allows you to create more advanced and more appealing email instead of plain text. you have any questions, feel free to drop me a message. And as usual, I look forward to seeing you in the next video.