THANK YOU! Was stuck on this for ages. It doesn't work with the latest version of phpmailer but I downloaded a release from when this vid was made in 2017 and it seems to be working okay.
it works thnx a lot . Put the files in the same folder. Then instead of doing what he does do this: use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require './PHPMailer/src/Exception.php'; require './PHPMailer/src/PHPMailer.php'; require './PHPMailer/src/SMTP.php'; and For those whose email is not being sent do these two steps: 1. Go to 'My Account' in Google (Not gmail account), then in Sign in & Security, enable 'Allow less secure apps'
This is cool and all, but my worry is hard-coding your password onto the source code. I know it's php, so users on the client-side won't be able to see but, but is there still some security issues? Normal users won't be able to see it, but would a hacker be able to look at your php source code, and therefore your login information? If so, what can we do to input our long-in credentials, but without hard-coding them into our code?
Doesnt work. Outdated, or am I missing something? Had to download the autoload file seperately, and change an outdated function inside of it called '__autoload' to 'spl_autoload_register' to remove an error message. Also downloaded some of the other class.php-files missing from the package (not sure if they mattered). I got to remove all the error messages while running the index.php-file, but no mail got sent.. username and pw are of course correct, but is there something else to worry about?
@@shawngrant9488I did manage to make it work after a while, and if I remember correctly I had to configure my gmail account to make it work with php. I think theres a tutorial for that, too. :)
For those whose email is not being sent do these two steps: 1. Go to 'My Account' in Google (Not gmail account), then in Sign in & Security, enable 'Allow less secure apps' 2. Disable your antivirus
for anyone who can't find PHPMailerAutoload.php file, you need to download the older version which has the same files like in the video, don't thank me :) github.com/PHPMailer/PHPMailer/archive/v5.2.25.zip
Fatal error: require_once(): Failed opening required 'PHPMailer/PHPMailerAutoLoad.php' (include_path='C:\xampp\php\PEAR') i have this kinda error pls help
I had this when I downloaded a later version of phpmailer than the one used in this video. I downloaded a version from 2017 and worked all good. Did you manage to figure out how to get the later version to work?
help please, I'm still a beginner in HTML, CSS, JS, jQuery, let alone PHP. I don't really understand how I can access the localhost/tutorials/gmail-send/ because it wasn't show in the video.. please help
I found this troubleshooting through my gmail account: "To help keep your account secure, from May 30, 2022, Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password." Is this the reason the actions from this video doesnt work anymore?
You used the path as "localhost/tutorials/gmail-send/" So here what is the path for localhost here I mean the base PATH" I'm trying to install it on remote server. I'm wondering how I replace localhost with what PATH?
Hello this is an awesome technic. i thank you for the tutorial, i would love to know can i make t attach a file with PHPMailer, something like an invoice from the Database
I disabled my antivirus and the google accounts security stuff but the same error appears everytime i try: 2019-07-19 12:20:48 SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting I'm using localhost with xampp. Any ideas of how can i fix it? Thank you
Can we set the address that we are sending the email to to a variable so that we can send emails to more than just the singular one defined in the code? I have a contact form and I've been wanting to be able to email users back once they hit submit.
hey, thanks for the video, but the thing is after following exactly the same steps as you did I'm still not able send mail, using $mail->ErrorInfo gives me " SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting ". Also please let me know if it's necessary to use the setFrom(); is there other way around? Thanks.
Is there any way to account for the gmail email sending limit? Like if the sending fails, try sending it through an alternate account? How would you code that?
even if there's no way to know if the sending failed, surely there's a way to keep track by updating a variable on the site so it counts how many have been sent and then switches to another account... how to do that? the whole updating a variable that gets reset daily? oh that's another thing, what timezone does google's daily limit reset on?
If you're sending loads of emails try a service that's specifically designed for sending loads of emails! I'm sure that swapping accounts to circumvent the limit is against Google's ToS.
This what i get Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in C:\xampp\htdocs\ka-kard\pages\PHPMailer\PHPMailerAutoload.php on line 45
Thanks, that's great. But it would be even better if there was a (clearly explained) way to download the index.php code. Or, why not copy-paste it directly in the description?
Hey how code i dont know why mine isn't working nothing is been sent ive checked the code like thrice now everything is as you have put it...whT can be the issue??
gmail has an auto protect issue against less secure websites, go to your myaccount.google.com and turn on allow less secure apps, that was the issue for me.
i am getting this error 2018-02-22 11:22:01 SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting Mail Not Sent
With debug level set to 3 I'm getting this error: Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1 OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed My website is hosted on my own PC for the time being and I haven't set up a mail program on it, thinking I could just send everything to Google's SMTP. However, it looks like I need to generate a certificate locally to send but I've no idea how to do that. Or else override the certificate requirement but again, I haven't a bog's notion. (openssl is enabled on my server, FWIW) Anyone else resolved a similar issue?
Fatal error: Uncaught Error: Class 'PHPMailer' not found in D:\xamp\htdocs\send mail\send_mail.php:3 Stack trace: #0 {main} thrown in D:\xamp\htdocs\send mail\send_mail.php on line 3 can u plz tell me how to slve this error
I have solution. You can use this option with updated New Class library. You will not get error. 100% Solution ruclips.net/video/DPGfNYkTkJ0/видео.html
it shows up this error : 2017-07-10 16:11:40 SERVER -> CLIENT: 2017-07-10 16:11:40 SMTP NOTICE: EOF caught while checking if connected 2017-07-10 16:11:40 SMTP Error: Could not authenticate. 2017-07-10 16:11:40 SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting What's the problem ?
my php_openssl.dll was commented by default in php.ini so removed ; from it and then it brought me another error of module can not be loaded, then I removed ; from extension path. I am sharing this so it may help someone else. By the way, big thanks for the tutorial.
Got the following error: 2018-08-09 01:52:53 SERVER -> CLIENT: 2018-08-09 01:52:53 SMTP NOTICE: EOF caught while checking if connected 2018-08-09 01:52:53 SMTP Error: Could not authenticate. 2018-08-09 01:52:53 SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting what does it mean?
I get "SMTP connect() failed" My code is the same as yours except I'm using port 587 since 465 gives me the "Username & Password not accepted" error for some reason. Any thoughts?
depending on your service of email this if you use a gmail account you can use this but if you use a service like outlook or hotmail then you need to search for the smtp settings. This would be different from gmail....
I've made a video covering parts that were not shown here: ruclips.net/video/oKbr2lRD7lQ/видео.html p.s. I do not mean to attack this great video, just showing things in another angle
For those looking for the autoload file, go to the branch selector on the left side of the download bar and choose 5.2-stable instead of master.
thankssssss
Thanks bro
bro
thaaankksss
Can't thank you enough!
THANK YOU! Was stuck on this for ages. It doesn't work with the latest version of phpmailer but I downloaded a release from when this vid was made in 2017 and it seems to be working okay.
it works thnx a lot .
Put the files in the same folder. Then instead of doing what he does do this:
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require './PHPMailer/src/Exception.php';
require './PHPMailer/src/PHPMailer.php';
require './PHPMailer/src/SMTP.php';
and
For those whose email is not being sent do these two steps:
1. Go to 'My Account' in Google (Not gmail account), then in Sign in & Security, enable 'Allow less secure apps'
This is cool and all, but my worry is hard-coding your password onto the source code. I know it's php, so users on the client-side won't be able to see but, but is there still some security issues? Normal users won't be able to see it, but would a hacker be able to look at your php source code, and therefore your login information? If so, what can we do to input our long-in credentials, but without hard-coding them into our code?
Doesnt work. Outdated, or am I missing something?
Had to download the autoload file seperately, and change an outdated function inside of it called '__autoload' to 'spl_autoload_register' to remove an error message.
Also downloaded some of the other class.php-files missing from the package (not sure if they mattered). I got to remove all the error messages while running the index.php-file, but no mail got sent.. username and pw are of course correct, but is there something else to worry about?
Did you ever resolve this issue? I'm having this issue now too. Did exactly everything you did too
@@shawngrant9488I did manage to make it work after a while, and if I remember correctly I had to configure my gmail account to make it work with php. I think theres a tutorial for that, too. :)
Guys you have to go to the releases in the github page, and then search for the 5.2.22 version, the one released Jan 9 2017. Hope you found it!
github.com/PHPMailer/PHPMailer/tree/5.2-stable
If we send many mails ,we must pay to for that?
Didn't work initially, then changed ssl to tsl1.3 and port to 587, works perfectly now
tks dude!! April 2020 STILL WORKING !.. VERY THANKS
For those whose email is not being sent do these two steps:
1. Go to 'My Account' in Google (Not gmail account), then in Sign in & Security, enable 'Allow less secure apps'
2. Disable your antivirus
Anish Pereira I
Man!!! I tell you, you are life saver!!!!. :D
Ouh man, you're saved my life today :")
Thank you
Thank you.....you're a life saver
for anyone who can't find PHPMailerAutoload.php file, you need to download the older version which has the same files like in the video, don't thank me :) github.com/PHPMailer/PHPMailer/archive/v5.2.25.zip
Thanks man
thanks brow
Do we need an SSL certificate on SMTP secure?
Fatal error: require_once(): Failed opening required 'PHPMailer/PHPMailerAutoLoad.php' (include_path='C:\xampp\php\PEAR')
i have this kinda error pls help
I had this when I downloaded a later version of phpmailer than the one used in this video. I downloaded a version from 2017 and worked all good. Did you manage to figure out how to get the later version to work?
TQ very much.. fast and simple and most importantly work perfectly!!
In my laptop, code runs without any error but when I check my account it displays that no email sent.what could be the problem?
Go to google security setting.. On less secure app access,.. It will be off if not used for a certain time , just for security resons..
the PHPMailer function is not found becouse the package is updated
any one know what the new function's name ?
I don't even use it for gmail but it's still helpful for my needs thank you!
help please, I'm still a beginner in HTML, CSS, JS, jQuery, let alone PHP. I don't really understand how I can access the localhost/tutorials/gmail-send/ because it wasn't show in the video.. please help
Absolute gold, thank you
autoloader file is not there , in the folder php mailer as that is downloaded
use version 5.2.26 there the file is
Thanks sir! Finally i find this awesome tutorial! Thank you!!
When I am downloading the phpmailer library some of the files and folders are not downloaded . I dont understand why?
So fast and furious but it done the job. Nice thanks.
Hey I'm getting this error
Failed open stream
Require once() failed opening requires '/phpmailerdoc/PHPMailerAutoload.php
Means it couldn't find the file PHPMailerAutoload.php in phpmailerdoc. Download the stable 5.2 version.
Got the same problem and this solved it ruclips.net/video/oKbr2lRD7lQ/видео.html
This worked. Thanks a million
I found this troubleshooting through my gmail account: "To help keep your account secure, from May 30, 2022, Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password."
Is this the reason the actions from this video doesnt work anymore?
are still working if it is online?, I mean not in localhost. thanks before
I will recommend this video to my friends. Thanks a lot @howCode
You used the path as "localhost/tutorials/gmail-send/" So here what is the path for localhost here I mean the base PATH" I'm trying to install it on remote server. I'm wondering how I replace localhost with what PATH?
Hello this is an awesome technic. i thank you for the tutorial, i would love to know can i make t attach a file with PHPMailer, something like an invoice from the Database
Me has one question! What is the difference between all the emails you typed in? Thanks
That's just an example e-mail , and how to use it? up to your desicion.
I disabled my antivirus and the google accounts security stuff but the same error appears everytime i try: 2019-07-19 12:20:48 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
I'm using localhost with xampp. Any ideas of how can i fix it?
Thank you
Hello! is the $headers section important because if I omit the $headers section, my mail function won't work. It will only work if I include it...
Can we set the address that we are sending the email to to a variable so that we can send emails to more than just the singular one defined in the code?
I have a contact form and I've been wanting to be able to email users back once they hit submit.
yes it is possible take it in as $email and assign its value using $post
Thank you!!
is the PHPMailAutoload now called autoload.php in the vendor folder?
hey, thanks for the video, but the thing is after following exactly the same steps as you did I'm still not able send mail, using $mail->ErrorInfo gives me " SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting ". Also please let me know if it's necessary to use the setFrom(); is there other way around?
Thanks.
Hi! How could I put inside the body of the $message= ' '; ?
You Can't because this is a HTML email not PHP email
Try to
$email->isHPHP();
but i don't know this is work but try
Fatal error: Uncaught Error: Class 'PHPMailer\PHPMailer\PHPMailer' not found
Is there any way to account for the gmail email sending limit? Like if the sending fails, try sending it through an alternate account? How would you code that?
even if there's no way to know if the sending failed, surely there's a way to keep track by updating a variable on the site so it counts how many have been sent and then switches to another account...
how to do that? the whole updating a variable that gets reset daily? oh that's another thing, what timezone does google's daily limit reset on?
If you're sending loads of emails try a service that's specifically designed for sending loads of emails! I'm sure that swapping accounts to circumvent the limit is against Google's ToS.
oh crap. forget i said that then.
This what i get
Fatal error: __autoload() is no longer supported, use spl_autoload_register() instead in C:\xampp\htdocs\ka-kard\pages\PHPMailer\PHPMailerAutoload.php on line 45
facing same problem,did you find any solution?
It works
Thanks, that's great. But it would be even better if there was a (clearly explained) way to download the index.php code. Or, why not copy-paste it directly in the description?
right
Where to get the zip file. Where are autoload file i open all the link but can't find
Thanks bro, you are the life saviour
This helped a lot
Parse error: syntax error, unexpected '$mail' (T_VARIABLE) in C:\xampp\htdocs\cours\index.php on line 12
Looks like you're missing a ;
__autoload() is deprecated, use spl_autoload_register() instead Can you please how to resolve this error?
facing the same problem
@@alexlazellari6563 yeah I did
@@rohitsahu1443 deathhitter91@gmail.com email me
Hey how code i dont know why mine isn't working nothing is been sent ive checked the code like thrice now everything is as you have put it...whT can be the issue??
Add this line: $mail->SMTPDebug = 2; That'll show you what the problem is!
Failed to connect to server: (0) 2017-03-13 05:02:49 SMTP connect() This is what i get bro
gmail has an auto protect issue against less secure websites, go to your myaccount.google.com and turn on allow less secure apps, that was the issue for me.
Thanks man i also figured that out
I changed that, still nothing tho : /
The line: $mail->SetFrom(‘example@gmail.com’) is not working. Any solutions?
The page keeps loading for ever. please help.
Can I put this on my free web server?? will it work the same???
Yes
Google account ---> SIgn in security -- then -- Here, you need to keep Allow less secure apps : ON . After this you can send mail as gmail
is this still working this year?
Yes
If you wont PHP others projects subscribe me
is it possible to send same body but different subject to different recipient?
my guy thank you!!!!!!
Tnx bro....its working
How do I run this?
Which PHP version you're using.
phpmailer is updated there is no phpmailerautoload.php class. i am have a error
Same problem. Anyone know what to put in the require_once now?
github.com/PHPMailer/PHPMailer/archive/v5.2.25.zip
i am getting this error
2018-02-22 11:22:01 SMTP ERROR: Failed to connect to server: (0)
SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mail Not Sent
Thanks!
same error.. how do i fix it??? need help
can i use this without ssl. else how i do this without ssl.
With debug level set to 3 I'm getting this error:
Connection failed. Error #2: stream_socket_enable_crypto(): SSL operation failed with code 1
OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed
My website is hosted on my own PC for the time being and I haven't set up a mail program on it, thinking I could just send everything to Google's SMTP. However, it looks like I need to generate a certificate locally to send but I've no idea how to do that. Or else override the certificate requirement but again, I haven't a bog's notion.
(openssl is enabled on my server, FWIW)
Anyone else resolved a similar issue?
Can this work with gSuite?
Yes
why thats not working? without error and not working :'( i already active my email with smtp. please helpp
i've got no errors but its not sending email. please help
Subscribe me for PHP programming
Dear God slow down!!
he's Irish mate, listen faster
@@anythingandeverything264 😂🤣😂🤣
its perfect speed. holla
So what host would you recommend for a real life scenario?
Probably setting up a SMTP server for yourself.
Would sound like the better way, as you'd be saving money.
You could setup your own email server or you could use something like Amazon AWS Simple Email Service.
but then you'd have to have your computer on all the time.
0vrStart real world meaning assuming you have a remote server for everything
Thank you so much! I've been struggling a looong time! Thank you!
Fatal error: Uncaught Error: Class 'PHPMailer' not found in D:\xamp\htdocs\send mail\send_mail.php:3 Stack trace: #0 {main} thrown in D:\xamp\htdocs\send mail\send_mail.php on line 3 can u plz tell me how to slve this error
I have solution. You can use this option with updated New Class library. You will not get error. 100% Solution ruclips.net/video/DPGfNYkTkJ0/видео.html
how I can get password and user name ? please help me
it shows up this error :
2017-07-10 16:11:40 SERVER -> CLIENT: 2017-07-10 16:11:40 SMTP NOTICE: EOF caught while checking if connected 2017-07-10 16:11:40 SMTP Error: Could not authenticate. 2017-07-10 16:11:40 SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
What's the problem ?
You probably have the wrong username / password.
I resolved it by rewiriting the code ;)
Thank you @howCode Keep going , i'm waiting to make the project MVC , implementing Php with html sucks :/
Some files not connected
1:15 i cant find any Autoload file in the zip
Not working sir...showing a error with SMTP can not authenticate...can you please help...
Subscribe me for more details
It's not working for yahoo plz a video on yahoo also
You noy can men setup using Yahoo
May I have the link to I download the script which you using. Please
that old gmail interface
How to stop mail going into spam??
Phpmailer not sending in spam
Subscribe me
I can't get it to work but must i disable my antivirus?
u disabled brain
how to use phpmailer, if on hosting ,?
my php_openssl.dll was commented by default in php.ini so removed ; from it and then it brought me another error of module can not be loaded, then I removed ; from extension path. I am sharing this so it may help someone else. By the way, big thanks for the tutorial.
whats about this error ???
SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
did you resolve it?
not yet can you help please ???
i hosted the file to a different server and called it from my application. that is the only work around i could think.
Maybe your login details are incorrect?
What editor are you using ?
visual studio code
Address of which mail??
Got the following error:
2018-08-09 01:52:53 SERVER -> CLIENT: 2018-08-09 01:52:53 SMTP NOTICE: EOF caught while checking if connected 2018-08-09 01:52:53 SMTP Error: Could not authenticate. 2018-08-09 01:52:53 SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
what does it mean?
that mean EOF caught while chcecking
Thank you so Much!!
Sir It's not working in CPanel...
This is working in cpanel , if not working so code not rights
how if I have a button and message box ?
Using issey post
it works fine :), thanks
I get "SMTP connect() failed"
My code is the same as yours except I'm using port 587 since 465 gives me the "Username & Password not accepted" error for some reason.
Any thoughts?
Sure he changed his username and password. Use your own gmail broo
depending on your service of email this if you use a gmail account you can use this but if you use a service like outlook or hotmail then you need to search for the smtp settings. This would be different from gmail....
Code missing or gmail not allowed or file not connected
not working with no error message
What massage
why i dont have PHPMailerAutoload.php ??
read the comments
Download phpmailer 5.2 version
phpMailer complete files not download only few files is downloaded please upload phpMailer file again
Download phpmailer 5.2 version
how to send with PDF attachment ???????????????????????
Simply attachment file using
Thanks, it works, even on localhost.
Can I get this code for localhost
I've made a video covering parts that were not shown here: ruclips.net/video/oKbr2lRD7lQ/видео.html
p.s. I do not mean to attack this great video, just showing things in another angle
Which text editor is he using?
Atom
is fucking working thank you very .. you are the best
PHPMailer not found error HELPPPPPPPPPPPPPPP
there is any propsition ....
i want to link this php with the button form
if someone know ho to d it plz help me
thank you ^^
if your code is not working, can try to change
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
worked for me