Laravel 10 Setting Up SMTP with Cpanel Hosting

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there guys in this post I will show you how to send an email through cpanel SMTP server in laravel 10. so let's get started so you have a laravel live wire form like this rubber we have the name uh email that is email and then the message so you like to send such a message so that you can receive it within your Gmail so how do you go about it so let's get started now the first step you want to do is to go to your cpanel dashboard within your Hosting account so I believe you already have alarm Bell application that is deployed on the shared hosting so in this first step what you need to do is that you need to come here within us cpan dashboard and then click on cpanel so click on cpanel that is within this one and then you'll now be taken to the cpanel tools now within the cpanel tools here you're going to then you're going to type email for example uh the moment you type email we are going to have a filter of the kind of email functionalities you have within your cpana tools so here you're going to find the that is the email accounts so here within the emails account click on email accounts now within the emails account you're going to find list of emails that you have created that is a list of emails that you might have created uh so far one when you deployed your laravel application however if you don't have um an any email you can as well click on this button here which says create and then once you click on this button will be taken to that is create an email account and of course your domain will be presented here and then here you can type your email that is of course it could be let's say it would be email at webdevtrainee.com and then of course you give a password for that particular email so that now you can use that email to receive that is messages within a contact form from the laravel application all right so now let's go back again um let's go back again so where you have your list of emails what I'm going to do here because I already have um one of them that I've created that is several of them that I've created I'm going to click on connected devices so click on connected devices on one of the emails that you have you already have and then here you'll be taken to the mail client manual settings so here is whereby you can now configure a particular SMTP settings within a particular email and this is these are the settings that you need to do now look at here we have the username we have the password of course which is the one that you you have created within the email that you chose to create then you gave it already a password and then we have our incoming server we have bought a different ports for example for 19 1993 we have and then we have uh POP3 and then as well we also have the that is the port that is the POP3 it is 37 1995 and then we have outgoing server which has the port 465 and so forth so what do you mean by this image for example Port 1995 it just means that this is the incoming uh Port within your application like this so the port 1993 this one just watched it as it just um it leaves a copy of your email message while the POP3 this one will send whatever has now been brought to your domain that is the email the incoming message and then it will now send the entire message this one it will leave a copy or this other one it will send another thing is outgoing server we have SMTP Port 465.465 is also another cryptographic uh Port whereby it will also deliver your message based on the security of it so we have 465 and we have 587. so 465 being it is the the one that was originally registered for SMTP and it is of course it is used to send that is it is just used to encrypt of course your messages and but nowadays it has been uh I guess we don't use it most of the time because 537 is Now the default SMTP um port number that we use so as to send messages so the the difference is just the security of the two so I would highly recommend you use 557 instead of 465 all right so now that's what we have within now these are the settings that we are going to use so as to configure them within our DOT EnV file so what I would like you to do once we get done with this one I want us now we go to our DOT EnV file and to do that we need to come back again to the client area and then I want you to click on file manager within this you can also find file manager then you are of course within your cpanel tools but let's just have this now here what I'll need to do here is just to identify my application where I've deployed it and then I just need to open this file which is what here this is the file so what I'm going to do I'm just going to click edit and then click edit like that now here you're taken to dot EnV file remember these are the environmental variables that you add within your within a laravel application so you're going to come on the part which has the mail mailer mail host mail Port mail username and so forth so here you're going to set up for example the Mel mailer we're going to set up the SMTP remember the M sub TP is the symbol mail transfer protocol that will that is used to send emails so it is just like a postman who delivers your letters and then we have the mail host so the mail host here will be the the address of the post office and this in this case I mean the server where the emails will be sent from and received so that is the Mel Austin of course the port here just as just as Ed said we have the you have the 465 and we have the 587 so 465 is the is the earlier version that we used to to use and then first 5 465 was the earlier and then now 587 is the newer Port that we use and mostly it is the one that we use for SMTP um submission that is sending of messages now we also have demand username so how are you going to fill that out so you're going to identify the male um that is the mail that is the mail username is this one here and then you're going to uh place it there so that is the one that you're going to imagine that is simply that is just the the email itself that we had configured and also the password on that particular email that we had configured so you're going to fill out that password and the password of course it is the one that is coming from here when you set up your email so make sure you set up the email and you give the password like that now next we have is the encryption and in encryption here you just give we have to type two types of them we have TL TLS that is transport layer security and we have the SSL that is so secure sockets layer so secure sockets layer or SSL is the other version of the protocol and this one is uh it has vulnerabilities and security issues so it has been considered obscure or obsolete so it is no longer mostly used so what we use is the TLs which is the successor of SSL and it is the modern way to achieve secure communication so the it has different versions so just get to know that so it is secure more secure than the SSL so you'd want to use TLS for security purposes for more security then the mail from address of course this one will be the email that will be that's the person that is the when you send the letter the return address on the envelope so that return address on the envelope it is the one that will tell the recipients where the email came from so in this case you're going to have your email that you have set up as demand from address so that people can receive can see it is coming from your business uh or your site whichever application you have and then lastly this one is just there by default so this one you don't need to know about it yeah so that is what we have within our DOT EnV file and once you have that set up correctly now you should be able to send a message through our contact form here so let's contact from here you're just going to come here and then uh what you're going to do here is just Brian yes of brand and then here I'm going to our brand at Timber .com and then here I'm going to add something like a test message and then I click submit so once I click submit that is successful so thank you for your message so when I come here you can see here I have contact for Malibu so when I click on it you can see the contact for message and then we have the message that is the name the email that the input and then the message of course itself remember these ones they have been configured within our alarm that is contact form so that we can receive the particular details that is within it's an HTML form so you can customize this one however you like you can customize it so this is just an example of just to show you how to send particular emails now somebody may be asking how have I been able to receive image that is emails to um through this uh in Gmail so what I did here we have something we call email forwarder so when you come to let's go back let's see if this yeah so we have let me just go back so here we have what we call let me just go back we have what we call forwarder so there's four others here uh what similar what it simply means is that you can see this image here it has been forwarded to this Gmail to my Gmail here so what you do so what you do here you just come uh you already have your your server email created within your sharedustin account and then you identify the Gmail uh that is the Gmail email that you have and you add it as default to so it is very simple you just have that setup here add the folder and then once you click the add folder you'll be taken to a place where buy you can address that is addressed to forward and then of course the domain is going to be that one and then the destination is forward to email address uh that you want to forward it to so in this case I've already set up one so here what I need to do is just to indicate the the type of email that I will Gmail that I want to forward to another thing you need to know is that you can even have more than one Gmail that is the message can be forwarded to more than one Gmail account so you can add one for example you can see this this uh this uh email domain and I also have this other email domain you can see there are two of them and they are forwarding to the same Gmail so it means if I'm also using this one send the messages they're all going to be forwarded this to uh Gmail accounts that is if they are different of course because these ones are still the same so that is it guys on how to send emails with alarm Ben 10 remember this is level 10 and it is easy to configure this on the send your emails and you are able to receive them just like this so take note of the the dot EnV file because this is the most important part that we'll use to set up those that is the correct uh credentials and remember they are coming from your SMTP a mail client settings that's where you get to to identify all that all right guys so if you have any question post them in the comment section like this video share it with others uh as I say don't watch and go if it has been helpful Please Subscribe and let's meet let me meet you in the next video
Info
Channel: Web Dev Trainee
Views: 974
Rating: undefined out of 5
Keywords:
Id: jXd6F18c3us
Channel Id: undefined
Length: 14min 33sec (873 seconds)
Published: Wed Sep 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.