Send Mail Using PHP Mailer With Gmail SMTP | 100% Working PHPMailer Tutorial

  Рет қаралды 78,420

DCodeMania

DCodeMania

Күн бұрын

Hello Friends! In this video I'm showing you how you can send a mail using gmail SMTP and PHP Mailer library. I've used here live hosting server for testing. You can use this from your local server also.
In next PHP Mailer tutorial I'll show you how to send a contact form details using PHP Mailer.
Thanks for watching this video. If you like this video then hit like button, share this video, And Subscribe my Channel. Also like my Facebook page for latest updates.
♥ Facebook Page - / dcodemania
♥ Myself On FB - / sahil4rock
♥ Instagram - / sahil4rock
♥ Twitter - / dcodemania
~-~~-~~~-~~-~
Please watch: "#1 Payment Gateway Integration Using PHP (Instamojo) | Introduction Video"
• #1 Payment Gateway Int...
~-~~-~~~-~~-~

Пікірлер: 394
@manojalayer
@manojalayer 4 жыл бұрын
You have done great. You saved my time, Really appreciate. 100% working. No matter you are using mailer or sendmail, and I specially enjoyed the bird song coming most probably from your yard. I guess you are leaving in paradise. Wish you the best.
@vipin2356
@vipin2356 4 жыл бұрын
Sir words nhi h mere pass ki akhir kis words se m apka sukriya ada kru.... .. .. 7ghnte se lga hua tha sir mera error shi bhi hora tha.....sir bukh lg rhi thi but m fir b lga rha ki aj yr learn krke hi rhunga...or akhir ye hogya sir.... Thankuu so so sooo much sir.....
@kenedyinyamfombangfombang6140
@kenedyinyamfombangfombang6140 3 жыл бұрын
You just delivered me from the DARKNESS of a handful of other PHPMailer unsuccessful videos. You are the Boss bro
@mattrie2730
@mattrie2730 Жыл бұрын
Four years down the line, this video saved me 2022. Thanks bro 🍺🍺
@AshutoshSharma-ey3jt
@AshutoshSharma-ey3jt 3 жыл бұрын
Thank you so much . it's really 100% working PHPMailer
@richmondng3567
@richmondng3567 4 жыл бұрын
Legendary and outstanding tutorial,thank you so much!(submitted 23/3/2020)
@HamoudyMulti
@HamoudyMulti 5 жыл бұрын
I LOVE YOU MAN its been 3 hours trying to figure this out. it finally worked
@DCodeMania
@DCodeMania 5 жыл бұрын
👍👍 subscribe this channel also!!
@azamhossen9723
@azamhossen9723 5 жыл бұрын
u there?
@harshaldokhe1328
@harshaldokhe1328 3 жыл бұрын
Thank You so much for quality video... Code worked in first attempt only.
@alpaykoyuncuoglu3387
@alpaykoyuncuoglu3387 4 жыл бұрын
I've strived for days to do that. I succeed thanks to u, thank u so much
@crsundar
@crsundar 3 жыл бұрын
Thank you
@crsundar
@crsundar 3 жыл бұрын
Thank you
@anishag4849
@anishag4849 4 жыл бұрын
Fatal error: Uncaught Error: Class 'PHPMailer' not found in C:\xampp\htdocs\mail\index.php:3 Stack trace: #0 {main} thrown in C:\xampp\htdocs\mail\index.php on line 3 getting this error
@pinkiebae1711
@pinkiebae1711 3 жыл бұрын
Thank you very much. For this helpful stuff. It works
@vishnuprasathv8843
@vishnuprasathv8843 3 жыл бұрын
THANK YOU SO MUCH.I GOT SUCCES SENDING MAIL. AFTER SEEING THIS GOOD CODE.
@alIndot
@alIndot 3 жыл бұрын
King👑You dropped that👑👑Thank you so much ❤️!!!!!!!!!!!
@nohero7927
@nohero7927 5 жыл бұрын
Its working for me, thanks to this. i just wonder how much email can be sent per day?
@Mimiz_AD
@Mimiz_AD 5 жыл бұрын
Thank you ! شكرًا (in Arabic) Tanmirth ( in kabyle) ⵝⴰⵏⵎⵉⵔⵝ (in Amazigh)
@youssradebbali7726
@youssradebbali7726 4 жыл бұрын
Hmimi Adalou code source 3afak???
@Mimiz_AD
@Mimiz_AD 4 жыл бұрын
I don’t understand !!
@Mimiz_AD
@Mimiz_AD 4 жыл бұрын
Sorry !!
@IncredibleGilgitBaltistan
@IncredibleGilgitBaltistan 4 жыл бұрын
Love your Video WolfMania, It Worked.
@youssradebbali7726
@youssradebbali7726 4 жыл бұрын
Faraz ahmed code source merci??
@IncredibleGilgitBaltistan
@IncredibleGilgitBaltistan 4 жыл бұрын
@@youssradebbali7726 send email
@youssradebbali7726
@youssradebbali7726 4 жыл бұрын
dblyoussra1998@gmail.com Thank uuu🤩💝💝💝💝💝💝
@eradeveloper8783
@eradeveloper8783 4 жыл бұрын
thank of lot sir .........................i m very tired...you are my solve this problem thanks ........
@eradeveloper8783
@eradeveloper8783 4 жыл бұрын
localhost working but live not working....i use $mail->SMTPDebug = 2; then error message is = Could not instantiate mail function. how to solve
@DCodeMania
@DCodeMania 4 жыл бұрын
Check is your hosting provided you mail services???
@rks-cgh-kfti6713
@rks-cgh-kfti6713 5 жыл бұрын
God damn man! It is awesome! This is that I always wanted to integrate to my websites! I love you man! If I would shake your hand! I tried it a lot of ways but it never worked proberly! But your video helped me to build up much cooler and safer websites! I love you! Thank you very much for helping us! I subscribed you!
@DCodeMania
@DCodeMania 5 жыл бұрын
😊😊😊😊
@sudarshangadekar1765
@sudarshangadekar1765 4 жыл бұрын
Thank You So Much For The Quality Content.
@hamzajaved7878
@hamzajaved7878 4 жыл бұрын
you are great sir thank you you are awaesome
@youssradebbali7726
@youssradebbali7726 4 жыл бұрын
Hamza javed code source please
@selvamails
@selvamails 5 жыл бұрын
You are the best sir............thank u so much
@DCodeMania
@DCodeMania 5 жыл бұрын
Welcome!!!😊😊😊 Subscribe this channel!!!
@selvamails
@selvamails 5 жыл бұрын
@@DCodeMania thanks for the reply , i subscribed sir, when i uploaded my code in net4india i am receiving email but the name email and message was empty sir , what can i do
@DCodeMania
@DCodeMania 5 жыл бұрын
Show me your codes!!
@selvamails
@selvamails 5 жыл бұрын
@@DCodeMania
@selvamails
@selvamails 5 жыл бұрын
Thank you so much sir, for spending time with subscribers.....Your code is very simple also....thank you sir.
@navas3481
@navas3481 4 жыл бұрын
Excellent... very much useful.. thanks broooo
@NadeemWBR
@NadeemWBR 4 жыл бұрын
Thanks Bro.. helped me after long time...
@kousalya9703
@kousalya9703 5 жыл бұрын
It worked for me. Thanks alot!!
@DCodeMania
@DCodeMania 5 жыл бұрын
Welcome!!!😊😊 Please subscribe this channel also!!!
@Aliraza-od1vt
@Aliraza-od1vt 5 жыл бұрын
very helpful tutorial, thanks alot!
@DCodeMania
@DCodeMania 5 жыл бұрын
Subscribe this channel also!!!
@antonjaycabato2913
@antonjaycabato2913 4 жыл бұрын
Thank you so much😘 it's working
@isfanrachmad8545
@isfanrachmad8545 5 жыл бұрын
Thanks dude it works 100%
@DCodeMania
@DCodeMania 5 жыл бұрын
Subscribe this channel also!!!😊😊🙏🙏
@HaveAGodDay_
@HaveAGodDay_ 5 жыл бұрын
Thank you so much it's really working!!!
@DCodeMania
@DCodeMania 5 жыл бұрын
Subscribe this channel also!!!!🙏🙏🙏🙏😊😊
@takrimangalinga4217
@takrimangalinga4217 5 жыл бұрын
Thank you very much, it is more helpful
@DCodeMania
@DCodeMania 5 жыл бұрын
Subscribe this channel also!!!
@girijaprasadbhattarai4435
@girijaprasadbhattarai4435 2 жыл бұрын
Thank you soo much sir.... love this🥰
@manuelnaim9206
@manuelnaim9206 5 жыл бұрын
It works !! finally a tutorial that works jeje
@DCodeMania
@DCodeMania 5 жыл бұрын
Subscribe this channel also!!!😊😊😊
@vivek5147
@vivek5147 4 жыл бұрын
How to stop mail going spam plz explain
@corazongaming4962
@corazongaming4962 4 жыл бұрын
Thanks bro, this is working on my localhost, but i tried to hosting. mail can't send. solved i delete : $mail->isSMTP();
@ancyea
@ancyea 4 жыл бұрын
Thank you for this tutorial. Does this work in codeigniter?
@fredomplay8856
@fredomplay8856 5 жыл бұрын
Great Video Bro, Love From #Pakistan. :)
@DCodeMania
@DCodeMania 5 жыл бұрын
Thx😊😊🙏🙏
@enesalan8116
@enesalan8116 6 жыл бұрын
You are the best! Thanks mate.
@swethass9773
@swethass9773 6 жыл бұрын
thanks a lot you saved my life!!!!! :D
@DCodeMania
@DCodeMania 6 жыл бұрын
👍👍👍👍 subscribe this channel if you liked this!!
@simeonbalabanov5824
@simeonbalabanov5824 4 жыл бұрын
Well it is not working, first I had error in autoload() and I fixed it, it wasn't detecting that my PHP version is bigger then the requested. And now it gives another error: Extension missing: openssl and this is not true because it is turned on. And the check in the cmd shows the same! php -i | findstr OpenSSL OpenSSL support => enabled OpenSSL Library Version => OpenSSL 1.1.1d 10 Sep 2019 OpenSSL Header Version => OpenSSL 1.1.1d 10 Sep 2019 OpenSSL support => enabled
@troyurtiz183
@troyurtiz183 2 жыл бұрын
THANK YOU SO MUCH I WILL NOW LIKE, SUBSCRIBE, AND HIT THE BELL BUTTON!
@vishwayethorathuru8937
@vishwayethorathuru8937 5 жыл бұрын
Thanks, bro it worked for me
@DCodeMania
@DCodeMania 5 жыл бұрын
Subscribe this channel also!!!!😊😊
@mimizmimiz1955
@mimizmimiz1955 5 жыл бұрын
OOooh !!! Thank you a lot! it's à great tuto! but how can i use accent like à è é ... i have a prolem with it
@Mimiz_AD
@Mimiz_AD 5 жыл бұрын
I have the same problem !
@fkkirk3714
@fkkirk3714 Жыл бұрын
google gmail account no longer has the Turn less secure apps on... and it sef to off by default, how do I change it when it no longer exists as a feature?
@haythamhammoud5787
@haythamhammoud5787 3 жыл бұрын
work good on my local host , but not on my server . any idea .
@justineandreiparong8255
@justineandreiparong8255 2 жыл бұрын
Can i ask you if the file was connect in hosting or not ?
@codebasic8558
@codebasic8558 2 жыл бұрын
I am running this code on a live server. I get a message that mail was successfully executed but I did not receive a mail. Why could this be?
@clintongallagher
@clintongallagher 5 жыл бұрын
January 16, 2019 this scriptwill not connect to smtp.gmail.com Perhaps Google has changed what is required for the gmail account used to connect.
@mohammedelghazal6077
@mohammedelghazal6077 3 жыл бұрын
Thank you, bro so much
@omprakashmadkar2516
@omprakashmadkar2516 3 жыл бұрын
Autolod() is not support show fatal error
@icaicastillo1529
@icaicastillo1529 6 жыл бұрын
Thank you so much for this!!
@dondomiedungca676
@dondomiedungca676 6 жыл бұрын
nice sir, it's worked
@rexwarvat6296
@rexwarvat6296 4 жыл бұрын
THANKS! YOU'RE A LEGEND
@paulorellon2283
@paulorellon2283 5 жыл бұрын
I think this only work for 32 bit OS users. Tried it with 32-bit OS and it was so smooth, NOT EVEN ONE ERROR found. 64-bit, ERROR FOUND
@johnwhaley4385
@johnwhaley4385 3 жыл бұрын
Does this somehow give google your business email data?
@aureamarizacandida7429
@aureamarizacandida7429 4 жыл бұрын
Obrigada ! ajudou bastante
@darwinplata
@darwinplata 3 жыл бұрын
I received this message: SMTP ERROR: Failed to connect to server: Connection refused What's wrong? Thank you!
@priyasharma8315
@priyasharma8315 5 жыл бұрын
thank you so much ...its works
@DCodeMania
@DCodeMania 5 жыл бұрын
Welcome!!!😊😊 Subscribe this channel also!!!!
@blackwhitearmy3672
@blackwhitearmy3672 2 жыл бұрын
Good.. thanks
@MadghostRandom
@MadghostRandom 4 жыл бұрын
You saved my life ty bro! +1 Sub! +1 Like!
@adilmalik1232
@adilmalik1232 5 жыл бұрын
Thank You So Much For The Quality Content. i just tried the code you explained i got confirmation message on html website but message is not sending through gmail Can you please help me out much Appreciated
@hirakdeuri1496
@hirakdeuri1496 5 жыл бұрын
Help Me! brother its not working in live server.
@DCodeMania
@DCodeMania 5 жыл бұрын
Show me your codes!!!
@adeelbaig1455
@adeelbaig1455 4 жыл бұрын
work like a charm
@melvindogbo125
@melvindogbo125 4 жыл бұрын
Thanks Bro, it works !
@resurreccionmicop.2238
@resurreccionmicop.2238 3 жыл бұрын
Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in C:\xampp\htdocs\Proj\Phpmailer\PHPMailerAutoload.php on line 45 I get this error, once i turn off the less access in google i can send email once. when I send again it cant send
@archanamaurya7759
@archanamaurya7759 4 жыл бұрын
Code is not working ...this phpmailer is deprecated..plz. Help
@DCodeMania
@DCodeMania 4 жыл бұрын
Go to this link dcodemania.com/contact-form-phpmailer/
@mohithn2007
@mohithn2007 3 жыл бұрын
Am getting error like call to undefined method PHPmailer::addReplayTo()... Plz Tel me
@AlexanderJWolf
@AlexanderJWolf 3 жыл бұрын
Thanks a lot man keep it up
@rajeshazmeera8495
@rajeshazmeera8495 3 жыл бұрын
No its not working after deploy in aws ec2 instance, getting smtp connect() failed error, please help me about this issue
@gagryuribeg2
@gagryuribeg2 6 жыл бұрын
Excelent! May I know why mails sent by this script ended up in spam folder on destinations?
@DCodeMania
@DCodeMania 6 жыл бұрын
use same email id in both place in Username and in addAddress then your mail will go to inbox.
@gagryuribeg2
@gagryuribeg2 6 жыл бұрын
in username shoul be the id mail account created in the cpanel (it is always the same) , in addaddress is the id mail destination (change according to the user that use the application), so they can't be the same
@DCodeMania
@DCodeMania 6 жыл бұрын
Gabriel Uribe sorry I've told you wrong......use same email id in both Username and setFrom
@gagryuribeg2
@gagryuribeg2 6 жыл бұрын
Yes, I did that before you told me but get same result, even I add this line $mail->Sender='mymail@tecflucol.com'; but didn't work
@omprakashmadkar2516
@omprakashmadkar2516 3 жыл бұрын
Message has been send show but I don't receive any massage on mail
@abdullahfuad8560
@abdullahfuad8560 5 жыл бұрын
Thanks Man Great video.
@kamalakantapanda4255
@kamalakantapanda4255 3 жыл бұрын
thanks for lovely content
@vladvlad4889
@vladvlad4889 5 жыл бұрын
I`m using XAMPP and this still not working for me(((
@NoName-kt3ny
@NoName-kt3ny 4 жыл бұрын
Is this work for any smtp ???
@DCodeMania
@DCodeMania 4 жыл бұрын
Yes
@NoName-kt3ny
@NoName-kt3ny 4 жыл бұрын
Can you give me your telegram ?
@NoName-kt3ny
@NoName-kt3ny 4 жыл бұрын
I need your help
@manideep_talampally
@manideep_talampally 4 жыл бұрын
If we disable 2 step verification, it's less secured right ?
@entp457
@entp457 4 жыл бұрын
it worked in localhost but it didnt work online server. when i submit the page display “message has been sent” but it didint send ? it is server problem or anythin else??
@DCodeMania
@DCodeMania 4 жыл бұрын
Don't use $mail->isSMTP(); in live server
@vipin2356
@vipin2356 4 жыл бұрын
Sir ye online server pr kam nhi ktrha.....subdomain h sir infinityfree ka...uspr work nhi krrha ye
@bikashgurung921
@bikashgurung921 5 жыл бұрын
mail is sen to spam folder only. Please how to fix problem?
@budmiller3723
@budmiller3723 5 жыл бұрын
Very good sir.
@Georges_Tanios
@Georges_Tanios 4 жыл бұрын
Thanks helpful !!
@marwinvaldez6533
@marwinvaldez6533 5 жыл бұрын
its working in my localhost when i put $mail->isSMTP(); ....but when i put in live and remove // $mail->isSMTP(); the display in my screen is Message could not be sent.
@kaynalyn
@kaynalyn 2 жыл бұрын
thanks for this, lovelots!
@dondomiedungca676
@dondomiedungca676 6 жыл бұрын
sir my code working properly but after 1 day....it's suddenly not working..pls help
@shubhamkumar9722
@shubhamkumar9722 4 жыл бұрын
I am using in live server but I am stuck in error : Message could not be sent. Mailer Error: Could not instantiate mail function. Please help !
@durgeshsingh6380
@durgeshsingh6380 3 жыл бұрын
Thanks bro
@technicalskc
@technicalskc 5 жыл бұрын
Thank you sir so much
@DCodeMania
@DCodeMania 5 жыл бұрын
Thx for watching.... subscribe this channel also!!
@navettransfer4564
@navettransfer4564 3 жыл бұрын
Can you help. I get an error mail not sent
@chumar8928
@chumar8928 2 жыл бұрын
Working in localhost but not in 3 different hosting 🥺🥺🥺
@subhasishnathdev
@subhasishnathdev 5 жыл бұрын
I followed the exact code but while testing by loading the page in the end I'm getting this error "This page isn’t working XXXX.com is currently unable to handle this request. HTTP ERROR 500". Plz help.
@ancyea
@ancyea 4 жыл бұрын
Thanks. It worked in codeigniter but says autoload is deprecated
@DCodeMania
@DCodeMania 4 жыл бұрын
Download latest phpmailer using composer Go to this link dcodemania.com/post/send-mail-contact-form-phpmailer-gmail-smtp
@Shadow-fw9qc
@Shadow-fw9qc 4 жыл бұрын
i am facing error in 7 line stating Parse error: syntax error, unexpected '$mail' (T_VARIABLE) in C:\xampp\htdocs\mail\index.php on line 7 plz help
@DCodeMania
@DCodeMania 4 жыл бұрын
Just go this link and download source code dcodemania.com/send-mail-using-contact-form-with-phpmailer/
@manishalankala1622
@manishalankala1622 4 жыл бұрын
i dont find the initial 3 files you mention ,i tried on linux
@NadeemWBR
@NadeemWBR 4 жыл бұрын
just subscribed
@ludaxofficial
@ludaxofficial 3 жыл бұрын
People commentig in 2021 saying "omg this worked for mee 100%" are so lame lmao. Tutorial is good but outdated. People are so fake lol
@rajeshg8649
@rajeshg8649 4 жыл бұрын
If I do this, will my account safe???
@sohanagupta6460
@sohanagupta6460 5 жыл бұрын
These code does not work .when i try to run in localhost it shows that Message could not send.What should i do now
@DCodeMania
@DCodeMania 5 жыл бұрын
What error you are getting???
@sohanagupta6460
@sohanagupta6460 4 жыл бұрын
@@DCodeMania SMTP failed to connect() and also when I try to run the programme in localhost it shown message send but when i checked in gmail message is not showing.How i remove the error.
@virtiparekh4642
@virtiparekh4642 5 жыл бұрын
i m trying to implement this code via localhost but it did not work it give me an unsuccessful as error and via server i could not connect with server it shows me the error could not connect with server can you solve?
@DCodeMania
@DCodeMania 5 жыл бұрын
Try with $mail->isSMTP();
@virtiparekh4642
@virtiparekh4642 5 жыл бұрын
I tried but it give me as echo unsuccessful or else it gives me a blank screen after submitting
@jadejadigveejay3115
@jadejadigveejay3115 5 жыл бұрын
Sir message to send ho raha he but problem is it will tell so much time...so mail are skip.....so what can i do ??
@DCodeMania
@DCodeMania 5 жыл бұрын
Where you are using this??
@abhaykumar-ud2pl
@abhaykumar-ud2pl 5 жыл бұрын
hey i didnt get mail on gmai l did what u said i allow less secure app and 2 step verification but still i didnt get my mail on gmail ,can u help me brother
@2yinfotech139
@2yinfotech139 4 жыл бұрын
thanks man
@emailverf2195
@emailverf2195 5 жыл бұрын
it's showing mail not send what should i do im using localhost to send the mail
@manigandana8740
@manigandana8740 2 жыл бұрын
Is this code work for infinity free hosting?
#06 CRUD App Using PHP & Mysqli | Delete Record From Database
5:32
Send email with PHP | Create a Working Contact Form Using PHP
10:18
Dave Hollingworth
Рет қаралды 139 М.
Spongebob ate Michael Jackson 😱 #meme #spongebob #gmod
00:14
Mr. LoLo
Рет қаралды 7 МЛН
The day of the sea 😂 #shorts by Leisi Crazy
00:22
Leisi Crazy
Рет қаралды 1,5 МЛН
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 54 МЛН
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 95 МЛН
Send email from Localhost and PHP
6:49
PHPBasics
Рет қаралды 94 М.
Coding Was HARD Until I Learned These 5 Things...
8:34
Elsa Scola
Рет қаралды 475 М.
Using sendmail.exe sending Emails in PHP from localhost with SMTP
10:37
How to Set Up WP Mail SMTP with Gmail (Fix Failed Emails For Good!)
7:45
WPForms - WordPress Forms Plugin
Рет қаралды 200 М.
How to Use PHPMailer in Simple Way
8:58
Vivek Vengala - Developer Channel
Рет қаралды 29 М.
Learn Web Development And ACTUALLY Get A Job | Ultimate Guide
1:33:52
James Cross
Рет қаралды 1,4 МЛН
Brilliant Budget-Friendly Tips for Car Painting!
0:28
Handmade Heroes
Рет қаралды 2 МЛН
BIKE UPGRADE
0:12
For Crafts Sake
Рет қаралды 2,9 МЛН
I Tested 6 Different Steering Wheels for My Friend
0:15
CarStatic
Рет қаралды 11 МЛН
Легендарная КАЛАБА
0:53
Иван Курапов
Рет қаралды 385 М.
Пробил колесо #дальнобойпосша #дальнобойщик #сша #америка
0:52
Антон из США | Дальнобой
Рет қаралды 3,1 МЛН