Ohh, thank you so much for such a nice words! I hope that one day, with the help of my followers, it will become popular and it will help a lot of people to become a web developer much faster because I did it the hard way, and now trying to help others to make their dreams come true much faster than I made it. :D
Hello Senaid, I've watched your video and think it is very clear and easy to keep up with to install PHPMailer. I don't know if you are aware but recently PHPMailer 6.0.1. has been launched. I've been struggling to make it work but finally i did! Using the composer to create the vendor/autoload.php file This is the solution in order to replace the missing PHPMailerAutoload.php file If you want i can send you my code so you can share it with some of your followers.
Thank you so much for nice words and your generosity to give me the working code for the latest version of PHPMailer. However, I am aware of that and am already recorded a new video where I am talking about that version and showing how to use it. So, for those that are not able to make it work, they can watch the video on ruclips.net/video/-J9k4m1yhco/видео.html
cara, eu estava procurando algo que realmente funcionasse... aqui eu encontrei. parabéns pelo excelente trabalho. Guy, I was looking for something that really work... in your channel, I found it. Congratulation for your good job. Thank you very much.
one thing I just encountered today, I change my $mail->Host; $mail->Username and $mail->Password but it is still using the previous settings, like I don't want that domain anymore I changed it, I delete those lines and still sends it from same host, like what da heck ? do you know why and how to fix this problem ??? thanks in advance
I found out why now, in my sendmail.ini I had smtp_server=smtp.gmail.com, auth_username=myemail@gmail.com, auth_password=pass, once I changed that then it works. now the $mail->Host; $mail->Username and $mail->Password has no need in my code, I just deleted them and it still works lol, I have no idea how sendmail is related to phpmailer, like da faq
I usually don't make any changes in sendmail.ini, and I always do it from the script, which in the end prevent errors like this. However, I am glad that you found what is the problem!
EYES!!!!!!!!!!!!! This working, but with the smtp server of my hosting provider. With gmail throw : "Failed connect smtp visit gitbug/wiki/trouble.... and also the error php mailer couldn't initialise"
Very good... I downloaded your source code, but something is not working.... I'm working with Apache 2.4 and PHP 7...is it necessary modify anything like PHP.ini or change gmail preferences? And this message is happening: Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in Best Regards Wellington
Hi, Excellent, but Is there any other PHP plugin that can be used to send emails on the local server, its like PHPMailer works only on a real server. Thanks
I created a gmail account for the website am designing, is there any configuration or settings I need to do before I can use the account to send confirmation link?
thanks for the tutorial, it's really good learning from you, but please i have a question, 1. what if i want to send to email to more than one email 2. what if i want to design a html from to be sending the email, not sending it when i refresh a pages
Hi Senaid, Great video and well made. I will be subscribing. I do have one question... I too have been trying to set up PHPMailer using gmail. In fact, if I run it on local host, it runs perfectly and in fact a copy of the sent mail is clearly visible on the gmail platform's "sent" items. When I load it to the server it hangs and bombs out. I tried your tip of removing the mail->isSTMP(); line and it sends the email. But it must not be signing into the gmail to send such, because 1) I can't see a record of the email in the sent mail and 2) if I change the password to a wrong password in the code it still sends. Please advise on the fix for sending through gmail via phpmailer on a live server. Thank you.
Hi thanks for the tutorial. Pls how do I create a form where people fill and goes to an email. The fields are six or more. E.g. name, email, tel, address, subject, message, file upload etc. Most tutorial is only email, subject, message Thanks for your help
Nice video. I tried to use the PHPMailer contact form for my website that I built. But there are some missing in the PHPMailer that I use/download from github, the PHPMailer/Autoload.php and the rest like the video that you have is missing from PHPMailer.
Thank you! There are some changes on the GitHub, so for that reason, you are missing some files. However, you can download the source code files from this video, and get all the files that are missing. The link is in the description of the video.
OK ... So I finally found a version 5 of PHPMailer tucked away in my Downloads folder and things worked out fine as it featured a PHPMailerAutoload.php file. Google kept yelling at me for trying to access my account by means of an insecure program, but finally, after accepting the the necessary account option, things went fine. But still I have no clue of how to make current version six-o-something work ...
hi, thanks for the video. I wanted to ask, the form email field is the recipient's own email, so if I send an email with my own email, it sends to my own email address, and vice versa if a user was to enter their own email, it will send it to their own email. But, shouldn't it send the phpmailer form to the email address that I have set in the sender mail->setFrom??? I'm confused as to why it would send to the recipients email instead....
I think that you didn't understand it properly. As you can see in the code, we are setting two different parameters (addAddress, setFrom) and by doing that we are making sure that the email which is entered in the form will be used as an email from which email has been sent, and also we are setting where we are sending an email to make sure it's our own. Get it?
I tried to do as you did but apparently the version of phpmailer has changed. Version 6 now seems to work differently, though I tried to import PHPMailer and SMTP classes manually. I simply and plainly couldn't get phpailer to work. Do you have any suggestions as to where to download the phpmailer version you were using with this tutorial? Thanks in advance for any suggestions on how to get this fixed!
The version of this tutorial you can download from the link given in the video description or you can learn how to do it with latest version of PHPMailer: ruclips.net/video/-J9k4m1yhco/видео.html
sir i have download your code and only changed the email to and from address and when i am try to run its throwing This page isn’t working error .I am running it on lamp localhost.i have seen sources in chrome console and its showing index file as empty. btw its a great tutorial.thanks in advance
i am getting this in console(chrome).but showing index page as blank in sources here is link : drive.google.com/file/d/0B3F2tCCLYQj4SnhsU1dDQ0dtTEk/view?usp=sharing "Failed to load resource: the server responded with a status of 500 (Internal Server Error)". In Firefox page and console is blank no error here is link : drive.google.com/file/d/0B3F2tCCLYQj4ZnkxVkdJM2N4S1k/view?usp=sharing Hope u can help me with this.anyway Ur response was to good(quick) brother.
Coding Passive Income, thanks for replying back, I subscribed to your channel and I’m learning a lot about phpmailer. One other thing I wasn’t too sure about was, while coding my site, is it a good idea to have my whole site assigned to the php extension or should I separate my php, and html extensions and only have my php extension assigned to my mailer and payment setup... your advice would be appreciated thanks
What about a sample html form with validation? (foundation abide by the way). Could you, pls, show an examle of using oauth2.0. class with phpmailer + form to send messages from site!
Hello. Your video is very nice but I have one question. What should i write instead of localhost when I create the PDO object ($d=new PDO("mysql:dbname=name;host=localhost......")) if I want to put my website live
Even if you upload your website to some hosting, using "localhost" for your host should work just fine. However, there are some very rare hostings where "localhost" won't work, and if you have that case, just let me know what hosting are you using, and I will check what exactly do you need to use to connect.
if i view my files in localhost it works but now i bought a domain www.mrares.com and a host (dreamhost.com) and if you click the about link it throws a fatal error like this "Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Connection refused' in /home/rares2001beast/mrares.com/get-info.php:3 Stack trace: #0 /home/rares2001beast/mrares.com/get-info.php(3): PDO->__construct('mysql:dbname=my...', 'root', '') #1 /home/rares2001beast/mrares.com/about.php(1): require('/home/rares2001...') #2 {main} thrown in /home/rares2001beast/mrares.com/get-info.php on line 3"
Modure Rares are you sure that you have updated your database, user and password information, because you can't use the same login information as the one on localhost? However, you don't need to change host information, it is fine if you leave as localhost.
its not working..i will type index file same as your file..but at the time of checking condition the condition were going to else part ..please help me to solve this problemmmmm
Thanks you for your useful tutorial. But: When running the script I have received the following error: " Warning: require(phpmailer/PHPMailerAutoload.php): failed to open stream: No such file or directory " . I have a folder called phpmailer which is placed in the same folder as index.php. In fact, there is no file called PHPMailerAutoload.php in my phpmailer. In phpmailer folder, threre are just five following files: PHPMailer.php, SMTP.php, POP3.php, Exception.php and OAuth.php . What should I do ? From where I can download PHPMailerAutoload.php? because in original PHPmailer folder downloaded and extracted from hitGub, PHPMailerAutoload.php does not exist.
The reason is that you are downloading the source code for new version of PHPMailer, and in that one PHPMailerAutoload.php doesnt exist. So, you can download the source code from the description of this video or you can watch new tutorial: ruclips.net/video/-J9k4m1yhco/видео.html
I receive this email when I try sending the email using gmail: Sign-in attempt was blocked Someone just used your password to try to sign in to your account from a non-Google app. Google blocked them, but you should check what happened. Review your account activity to make sure no one else has access. how can I solve it please?
thanks man. i tried your other tutorial on sending email and it works like charm. but one think i wanna ask. i'm sorry but i can't seem to understand what you're saying on why we should use gmail instead of our hosting email. maybe you can reply to me. thank you so much :)
Thank you so much! The main reason is that if you use any shared hosting to send emails, there are huge chances that IP is already blacklisted and that most of the emails will be filtered as spam, while using the Gmail in most cases you are not going to have any issues if you are sending less than 500 emails per day.
hey it's me again. so something happened to my app. i was using my hosting email for sending mail. turned out it seems like my sent email is being held by google. it is received after more than 20 minutes or even not received at all. is it because my hosting ip is already blocked? and then i tried using gmail smtp but no luck. i'm worried now that my hosting ip is already blocked by google because i can't even use gmail smtp. it is working fine on localhost, but not my hosting server even though i tried disabling isSMTP() function
There are huge chances that you're right if you don't have any problem when you run the code on localhost, but you do have a problem when you run on your server. Also, do you get any error generated by PHPMailer?
Hello Coding Passive Income, great tutorial. I followed it all the way through and have verified that I am using the same code as you. However, I am not getting any email or any error. Please let me know what you will need from me in order to troubleshoot it. Thanks!
Perfect! Please let me know if you need anything else. Looking forward to troubleshoot this again tomorrow. I already have the files live if you want to test it out on your end. Here is the website where I have the contact page: torrescreations.com/ I had tried changing the emails and still got no error notification and no email to either emails I tried. Essentially I am trying to receive the emails to my torrescreations account with gmail. My hosting provider for the website is godaddy. Weird thing is that I was using the same (with maybe some minor changes) and it was working fine. But after I updated my website recently it stopped working, I had not done any changes on the form so not sure why it was not working. Tried troubleshooting and ended up finding your tutorial which used the same mailer so decided to try it out but still not working so beginning to think something might have changed with the hosting provider. But not sure if maybe also some of my gmail settings might be causing the issue. Looking forward to your feedback. Thank you so much for the help! Here is the html for the form:
Send Message -------------------------------------------------------END OF HTML CODE----------------------------------------------------------- Here is the PHP file for the form (contact_form.php): --------------------------------------------------PHP CODE END-------------------------------------------------------
add $mail->ErrorInfo; inside else block to show the error message. If the error said : SMTP connect() failed, turn allow less secure apps to ON in your gmail account and try again. If you still get the same error ,remove $mail->isSMTP(); then if you get an error that said :Could not instantiate mail function in this case you have to configure sandmail.ini that is inside you localserver folder: this example is for wampserver. 1-open sendmail.ini that is inside C:\wamp\sendmail\sendmail.ini 2: Edit the following options: smtp_server=smtp.gmail.com smtp_port=587 (587 if you use tls 465 if you use ssl) auth_username=user@gmail.com auth_password=your_password 3 -Edit sendmail_path value inside php.ini file as the following: sendmail_path = "C:\wamp\sendmail\sendmail.exe -t" Restart all services and the problem will be solved. This idea works with me.
There are two different ways how you can fix it: - download source code from the description of this video - watch my latest video tutorial about PHPMailer ruclips.net/video/-J9k4m1yhco/видео.html
Ab..no sir...in this video, the file is already with us...i mean, suppose there's a contact form & user upload a file... I need to mail this file along with other submitted contents to a client mail Id. That's my requirement...
I fixer DEPRECATED...but nothing about send email.... Changed: function __autoload($classname) { PHPMailerAutoload($classname); } To: spl_autoload_register(function($class) { PHPMailerAutoload($classname); });
Sir I am using xampp localhost and your code (with adresses changed). If I comment the isSMTP() i get an error couldnot instantiate smail function If i uncomment then it gives me an error smtp connect(): failed. Can you help me in this problem
Did you try the read documentation on that link? Maybe you can notice the problem that you have (because I don't know exactly what is your problem or what exactly is happening on your side).
HI sir i followed all the step and it's working but not exactly work.. yes it said that ''Mail sent' but when i checked my email i couldn't find the message BTW i just run it on localhost but i've not try yet on a web host i wait for your reply have a good day
Its a same problem sir it display mail sent but i do not receive any mail i think the problem is in my server thanks for your help sir i think i'm going for a lower version of xampp have a good day sir.. may i ask you a request? can you please make a video tutorial for how to send a sms using php
Do you want to become a web developer from scratch??? Check this: bit.ly/devAccelerator
I’m humbled and appreciative for your flawless assistance. Thanks a million!
Right on brotha! I seen something in my code just slightly different then yours and BAM! 20 hours of headache gone! Thank you very much !
Your tutorials are absolutely amazing! I don't understand why you aren't more popular? Thanks :)
Ohh, thank you so much for such a nice words! I hope that one day, with the help of my followers, it will become popular and it will help a lot of people to become a web developer much faster because I did it the hard way, and now trying to help others to make their dreams come true much faster than I made it. :D
Živ bio Senaide... vrhunski tutorial.
Hvala puno!
"Comment out $mail->isSMTP(); on some Hosts to work" Solved my problem, big thanks :)
nessio qq Amazing, glad I could help. :)
Your videos/Tutorials are excellent explanation for beginners. Thankyou very much.
thank you :)
Hello Senaid,
I've watched your video and think it is very clear and easy to keep up with to install PHPMailer.
I don't know if you are aware but recently PHPMailer 6.0.1. has been launched.
I've been struggling to make it work but finally i did!
Using the composer to create the vendor/autoload.php file
This is the solution in order to replace the missing PHPMailerAutoload.php file
If you want i can send you my code so you can share it with some of your followers.
Thank you so much for nice words and your generosity to give me the working code for the latest version of PHPMailer.
However, I am aware of that and am already recorded a new video where I am talking about that version and showing how to use it. So, for those that are not able to make it work, they can watch the video on ruclips.net/video/-J9k4m1yhco/видео.html
cara, eu estava procurando algo que realmente funcionasse... aqui eu encontrei. parabéns pelo excelente trabalho.
Guy, I was looking for something that really work... in your channel, I found it. Congratulation for your good job. Thank you very much.
OMG that $mail->isSMTP(); was giving me a headache, didn't know I could commented and make email be sent, this is nuts, I thank you for that
Yeah, sometimes small things make a huge difference, glad I could help! :)
one thing I just encountered today, I change my $mail->Host; $mail->Username and $mail->Password but it is still using the previous settings, like I don't want that domain anymore I changed it, I delete those lines and still sends it from same host, like what da heck ? do you know why and how to fix this problem ??? thanks in advance
I don't. There isn't any reason why that would happen...
I found out why now, in my sendmail.ini I had smtp_server=smtp.gmail.com, auth_username=myemail@gmail.com, auth_password=pass, once I changed that then it works. now the
$mail->Host; $mail->Username and $mail->Password has no need in my code, I just deleted them and it still works lol, I have no idea how sendmail is related to phpmailer, like da faq
I usually don't make any changes in sendmail.ini, and I always do it from the script, which in the end prevent errors like this. However, I am glad that you found what is the problem!
just the tutorial I'm looking so straight forward thank you very much
Awesome, I am so happy that I could help you. :)
Learned a lot fro this video, thanks a lot and I appreciate your efforts for making this such an awesome video lecture.
thank you :)
THANK YOU. This is a very cool tutorial video. This is THE tutorial video. Everything is clear. Thanks again
thank you :)
EYES!!!!!!!!!!!!! This working, but with the smtp server of my hosting provider. With gmail throw : "Failed connect smtp visit gitbug/wiki/trouble.... and also the error php mailer couldn't initialise"
Great work, thank you very much
My pleasure, thank you :)
Pls which hosting company can I use to easily set this up cos I am having issues with the current hosting that am using
Thank you for this tutorial. It really helped me a lot!
Very good... I downloaded your source code, but something is not working....
I'm working with Apache 2.4 and PHP 7...is it necessary modify anything like PHP.ini or change gmail preferences?
And this message is happening:
Deprecated: __autoload() is deprecated, use spl_autoload_register() instead in
Best Regards
Wellington
Hi,
Excellent, but Is there any other PHP plugin that can be used to send emails on the local server, its like PHPMailer works only on a real server.
Thanks
PHPMailer is the best, and you can use it to send an email from localhost.
I created a gmail account for the website am designing, is there any configuration or settings I need to do before I can use the account to send confirmation link?
Awesome! it work. Thank you so much!
thank you :)
you the best tutor
I want to see a video about phpmailer+contact form+google recaptcha+ajax+warning messages for empty or not correctly filled fields.
Thank you very much, it's work. :)
Glad I could help :)
Can add toggle button for hiding and showing html table within mail body using phpmailer???
Or any another way
It works! Thanks so much!
thank you :)
Is that possible to create a simple dependent drop down box for Year and Month please?
Thank you for the great tutorial video again. :) Good Day
Yes, it's definitely possible. Thank you!
thanks for the tutorial, it's really good learning from you, but please i have a question,
1. what if i want to send to email to more than one email
2. what if i want to design a html from to be sending the email, not sending it when i refresh a pages
Thank you. I have already a tutorial that will answer both questions that you have:
ruclips.net/video/Mw_ORXPoogY/видео.html
Not working when I upload it on hosting then open my domain then nothing is showing???
Are you using the same code? Have you made any changes?
Hi Senaid, Great video and well made. I will be subscribing. I do have one question... I too have been trying to set up PHPMailer using gmail. In fact, if I run it on local host, it runs perfectly and in fact a copy of the sent mail is clearly visible on the gmail platform's "sent" items. When I load it to the server it hangs and bombs out. I tried your tip of removing the mail->isSTMP(); line and it sends the email. But it must not be signing into the gmail to send such, because 1) I can't see a record of the email in the sent mail and 2) if I change the password to a wrong password in the code it still sends. Please advise on the fix for sending through gmail via phpmailer on a live server. Thank you.
Hi thanks for the tutorial. Pls how do I create a form where people fill and goes to an email. The fields are six or more. E.g. name, email, tel, address, subject, message, file upload etc. Most tutorial is only email, subject, message Thanks for your help
hi , your video it's excelent but in this moment PHPMailler was updated, and i would like you to update your video , thanks
Hi, thank you for the feedback. Here is updated version: ruclips.net/video/-J9k4m1yhco/видео.html :)
Thanks for your great work!!
do you have a video of configuring aws to send a mail through php (with windows server 2012 wamp)
Thank you so much!!!
thank you :)
really nice and clean tutorial
thank you :)
I am from Bangladesh.. I know about Bosnia , your country. from my childhoood :)
Oh, nice! From childhood? That's interesting, how? :)
Can you tell me what should i configure for Wamp server, to run your code in local host?
yes, my uncle tried to go to Bosnia for doing job. But he tried a lot, but he didnt get vissa. Then from the child hood i knew this country name :)
Nice video. I tried to use the PHPMailer contact form for my website that I built. But there are some missing in the PHPMailer that I use/download from github, the PHPMailer/Autoload.php and the rest like the video that you have is missing from PHPMailer.
Thank you! There are some changes on the GitHub, so for that reason, you are missing some files. However, you can download the source code files from this video, and get all the files that are missing. The link is in the description of the video.
I see, thanks bro. :)
It's my pleasure! :D
I get the "message sent " text but when I check my imbox and spam I don't see the email. Can you please tell me what could be the problem?
OK ... So I finally found a version 5 of PHPMailer tucked away in my Downloads folder and things worked out fine as it featured a PHPMailerAutoload.php file. Google kept yelling at me for trying to access my account by means of an insecure program, but finally, after accepting the the necessary account option, things went fine. But still I have no clue of how to make current version six-o-something work ...
Amazing, glad you made it! Also, if you want to learn how to do it with PHPMailer v6, here you go: ruclips.net/video/-J9k4m1yhco/видео.html
would you make a update of your video since the library has been updated
Hi Sir, You are really amazing teacher and I understand how you explain the way. I would like know how do i sent more than 5 emails in the same time?
thanks owsum video helped me in my project.
thank you :)
it was very useful thank you sir
my pleasure, thank you!
0_0 ooooo. Wtf? It is worked! That video is helpful. Thanks
thank you :)
very nice and helpful
+113218499722923929406 thank you :)
Works! Thanks man
Awesome, glad I could help you! :D
I have been following some tutorials on this but still can't get it to work though... I have even allowed to use less secure apps
Pozdrav Senaid, jesi probao poslati mail s nasim znakovima "čć" u Subject?
hi, thanks for the video. I wanted to ask, the form email field is the recipient's own email, so if I send an email with my own email, it sends to my own email address, and vice versa if a user was to enter their own email, it will send it to their own email. But, shouldn't it send the phpmailer form to the email address that I have set in the sender mail->setFrom??? I'm confused as to why it would send to the recipients email instead....
I think that you didn't understand it properly. As you can see in the code, we are setting two different parameters (addAddress, setFrom) and by doing that we are making sure that the email which is entered in the form will be used as an email from which email has been sent, and also we are setting where we are sending an email to make sure it's our own. Get it?
Yes. Thank you.
My google account is denying to send mail. How to activate this feature for my gmail account(which is the mail sender)
I am using xampp as the localhost, is there any configuration I need to do?
I tried to do as you did but apparently the version of phpmailer has changed. Version 6 now seems to work differently, though I tried to import PHPMailer and SMTP classes manually. I simply and plainly couldn't get phpailer to work. Do you have any suggestions as to where to download the phpmailer version you were using with this tutorial? Thanks in advance for any suggestions on how to get this fixed!
The version of this tutorial you can download from the link given in the video description or you can learn how to do it with latest version of PHPMailer: ruclips.net/video/-J9k4m1yhco/видео.html
Thanks, bro!
It's my pleasure! :D
To Senaide legendo :)
Hvala puno :)
sir how about if u want to use a localhost wampserver? can u make a video tutorial? thanks your tutorials are absolute great. :)
Thank you! What exactly you would love to learn about wampserver?
sir i have download your code and only changed the email to and from address and when i am try to run its throwing This page isn’t working error .I am running it on lamp localhost.i have seen sources in chrome console and its showing index file as empty. btw its a great tutorial.thanks in advance
Do you get any error?
i am getting this in console(chrome).but showing index page as blank in sources here is link : drive.google.com/file/d/0B3F2tCCLYQj4SnhsU1dDQ0dtTEk/view?usp=sharing
"Failed to load resource: the server responded with a status of 500 (Internal Server Error)".
In Firefox page and console is blank no error here is link : drive.google.com/file/d/0B3F2tCCLYQj4ZnkxVkdJM2N4S1k/view?usp=sharing
Hope u can help me with this.anyway Ur response was to good(quick) brother.
Obviously you did something wrong in your code. Can yous how it to me?
Ok but would you need to make any adjustments in the php.ini and sendmail.ini file configuration before starting the code
No, you don't need.
Coding Passive Income, thanks for replying back, I subscribed to your channel and I’m learning a lot about phpmailer. One other thing I wasn’t too sure about was, while coding my site, is it a good idea to have my whole site assigned to the php extension or should I separate my php, and html extensions and only have my php extension assigned to my mailer and payment setup... your advice would be appreciated thanks
Don't stress too much about that, usually all my files are in PHP (except css, js etc.).
What about a sample html form with validation? (foundation abide by the way). Could you, pls, show an examle of using oauth2.0. class with phpmailer + form to send messages from site!
Thanks, thanks, thanks!
thank you :)
+1 for using Linux!
Žiga Lausegger Hehe, thank you!
can i use my own domain(from Webmail of CPanel) in this phpmailer to send/recieve messages through online server?
Yes, absolutely.
Coding Passive Income yea fine. It works. thank you.. Keep updated.. 😉
Thanks! 👌
what version of phpmailer are you using in this tutorial bruh?
Thank you!
thank you :)
hello
have you any tutorial about IMAP, POP3 in php? if not please create it
i think to send a mail from gmail we also need some changes in gmail setting because we are sending mail through gmail server
Usually you don't need to make any changes.
Hello. Your video is very nice but I have one question. What should i write instead of localhost when I create the PDO object ($d=new PDO("mysql:dbname=name;host=localhost......")) if I want to put my website live
Even if you upload your website to some hosting, using "localhost" for your host should work just fine. However, there are some very rare hostings where "localhost" won't work, and if you have that case, just let me know what hosting are you using, and I will check what exactly do you need to use to connect.
I am using dreamhost
if i view my files in localhost it works but now i bought a domain www.mrares.com and a host (dreamhost.com) and if you click the about link it throws a fatal error like this "Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000] [2002] Connection refused' in /home/rares2001beast/mrares.com/get-info.php:3 Stack trace: #0 /home/rares2001beast/mrares.com/get-info.php(3): PDO->__construct('mysql:dbname=my...', 'root', '') #1 /home/rares2001beast/mrares.com/about.php(1): require('/home/rares2001...') #2 {main} thrown in /home/rares2001beast/mrares.com/get-info.php on line 3"
please sir help me
Modure Rares are you sure that you have updated your database, user and password information, because you can't use the same login information as the one on localhost? However, you don't need to change host information, it is fine if you leave as localhost.
its not working..i will type index file same as your file..but at the time of checking condition the condition were going to else part ..please help me to solve this problemmmmm
can i use a basic gmail adress like "example@gmail.com" for the $mail->addAddress function?
Yes, of course. You can use any valid email address.
It's working awesome
Do i habe to include all these in the sign up code ?Please i really need your help
yes
I have done all the works and the "Email was sent" message was shown at the top, but I didn't receive the email inbox!
So cool it worked!!!
Awesome, glad I could help! :)
can u do a courses about nodejs ??? thanks
Yes, for sure!
Thanks, Bro)
thank you :)
sir i am getting the error SMTP connect() failed...every time when i use it either on localhost or from free hosting like 000webhost..plz help sir
Thanks you for your useful tutorial. But:
When running the script I have received the following error:
" Warning: require(phpmailer/PHPMailerAutoload.php): failed to open stream: No such file or directory " . I have a folder called phpmailer which is placed in the same folder as index.php.
In fact, there is no file called PHPMailerAutoload.php in my phpmailer. In phpmailer folder, threre are just five following files: PHPMailer.php, SMTP.php, POP3.php, Exception.php and OAuth.php .
What should I do ? From where I can download PHPMailerAutoload.php? because in original PHPmailer folder downloaded and extracted from hitGub, PHPMailerAutoload.php does not exist.
The reason is that you are downloading the source code for new version of PHPMailer, and in that one PHPMailerAutoload.php doesnt exist.
So, you can download the source code from the description of this video or you can watch new tutorial: ruclips.net/video/-J9k4m1yhco/видео.html
Is that filezilla you using to check smtp code?
What time in the video?
Brother PHP mailer is not working in live server. But it worls fine in a localhost. Why is it happening?
php don't works in live server
I receive this email when I try sending the email using gmail:
Sign-in attempt was blocked
Someone just used your password to try to sign in to your account from a non-Google app. Google blocked them, but you should check what happened. Review your account activity to make sure no one else has access.
how can I solve it please?
if the recipients' email is called from the table(xampp), how's the coding ?
All you need to do is to read it from the table (using MySQLi or PDO), and then the other part of the code is exactly the same.
I get this error escapeshellcmd() was disabled for security reaseon, how can I solve?
Try to add this line: $mail->isSMTP();
thanks man. i tried your other tutorial on sending email and it works like charm.
but one think i wanna ask. i'm sorry but i can't seem to understand what you're saying on why we should use gmail instead of our hosting email. maybe you can reply to me.
thank you so much :)
Thank you so much! The main reason is that if you use any shared hosting to send emails, there are huge chances that IP is already blacklisted and that most of the emails will be filtered as spam, while using the Gmail in most cases you are not going to have any issues if you are sending less than 500 emails per day.
ah i see. thank you so much. this really helps my project :)
Awesome, I am so happy that I could help you. :)
hey it's me again. so something happened to my app. i was using my hosting email for sending mail. turned out it seems like my sent email is being held by google. it is received after more than 20 minutes or even not received at all. is it because my hosting ip is already blocked? and then i tried using gmail smtp but no luck. i'm worried now that my hosting ip is already blocked by google because i can't even use gmail smtp. it is working fine on localhost, but not my hosting server even though i tried disabling isSMTP() function
There are huge chances that you're right if you don't have any problem when you run the code on localhost, but you do have a problem when you run on your server. Also, do you get any error generated by PHPMailer?
Hello Coding Passive Income, great tutorial. I followed it all the way through and have verified that I am using the same code as you. However, I am not getting any email or any error. Please let me know what you will need from me in order to troubleshoot it. Thanks!
Hi, all I need is to see your code. Also, are you trying to send an email from your localhost or from some hosting?
Perfect! Please let me know if you need anything else. Looking forward to troubleshoot this again tomorrow. I already have the files live if you want to test it out on your end. Here is the website where I have the contact page: torrescreations.com/
I had tried changing the emails and still got no error notification and no email to either emails I tried. Essentially I am trying to receive the emails to my torrescreations account with gmail. My hosting provider for the website is godaddy. Weird thing is that I was using the same (with maybe some minor changes) and it was working fine. But after I updated my website recently it stopped working, I had not done any changes on the form so not sure why it was not working. Tried troubleshooting and ended up finding your tutorial which used the same mailer so decided to try it out but still not working so beginning to think something might have changed with the hosting provider. But not sure if maybe also some of my gmail settings might be causing the issue. Looking forward to your feedback. Thank you so much for the help!
Here is the html for the form:
Send Message
-------------------------------------------------------END OF HTML CODE-----------------------------------------------------------
Here is the PHP file for the form (contact_form.php):
--------------------------------------------------PHP CODE END-------------------------------------------------------
Can you try to remove this line: $mail->isSMTP(); ?
I removed that line of code, went to the form and submitted it but still did not get an email. Anything else you can think might be the issue?
add $mail->ErrorInfo; inside else block to show the error message.
If the error said : SMTP connect() failed, turn allow less secure apps to ON in your gmail account and try again.
If you still get the same error ,remove $mail->isSMTP(); then if you get an error that said :Could not instantiate mail function in this case you have to configure sandmail.ini that is inside you localserver folder:
this example is for wampserver.
1-open sendmail.ini that is inside C:\wamp\sendmail\sendmail.ini
2: Edit the following options:
smtp_server=smtp.gmail.com
smtp_port=587 (587 if you use tls 465 if you use ssl)
auth_username=user@gmail.com
auth_password=your_password
3 -Edit sendmail_path value inside php.ini file as the following:
sendmail_path = "C:\wamp\sendmail\sendmail.exe -t"
Restart all services and the problem will be solved.
This idea works with me.
Very useful! Is the same settings for G Suite?
It should be, but I haven't tested it.
Coding Passive Income I tested it and it works fine. Thanks!
on the latest package, PHPMailerAutoLoad.php is no longer present.
There are two different ways how you can fix it:
- download source code from the description of this video
- watch my latest video tutorial about PHPMailer ruclips.net/video/-J9k4m1yhco/видео.html
I modified:
echo "Somethig is wrong: ".$mail->ErrorInfo;
The error:
Somethig is wrong: Could not instantiate mail function.
Great content sir... But one doubt, how to attach an uploaded file in the mail?
You can see how I am doing it on 12:25 of this video. Is that what you mean?
Ab..no sir...in this video, the file is already with us...i mean, suppose there's a contact form & user upload a file... I need to mail this file along with other submitted contents to a client mail Id. That's my requirement...
Oh, ok. I have a video tutorial on that topic, that will show you step-by-step how to make it. Here you go: ruclips.net/video/Mw_ORXPoogY/видео.html
Ok, sir. Let me try n get back to you
Sounds good. If you need any help, comment below that video so that others who are looking for the same solution can find it there. :)
I fixer DEPRECATED...but nothing about send email....
Changed:
function __autoload($classname)
{
PHPMailerAutoload($classname);
}
To:
spl_autoload_register(function($class) {
PHPMailerAutoload($classname);
});
Sir I am using xampp localhost and your code (with adresses changed).
If I comment the isSMTP() i get an error couldnot instantiate smail function
If i uncomment then it gives me an error smtp connect(): failed.
Can you help me in this problem
That's weird. Can you show me the code?
very nice
thank you :)
Dose not work with a local server like XAMPP.
Yes, it does.
Sir your code is working no error takes place but didn't send mail to email address.Please resolve my problem as soon.
Are you trying to send an email from the localhost or from the web hosting?
Sir , i am using local host..
Did you try the read documentation on that link? Maybe you can notice the problem that you have (because I don't know exactly what is your problem or what exactly is happening on your side).
thsi is my error Sir,
echo SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
May i send my code to you on your email.?
you are awesome bro
thank you :)
still not receive any mail from gmail.. :(
does this work from localhost xampp? or does this work only from a server?
Yes, it does.
What if attachment size is > 25mb ???
is the procedure same when u want to send email through local host in xampp?? thanks sir senaid :)
Yes, it should be.
It not worked using xampp serrver
yea exactly,, it also isn't working for me
sir , i did the same thing but i got error... i am using xampp.. please help me sir.
HI sir i followed all the step and it's working but not exactly work.. yes it said that ''Mail sent' but when i checked my email i couldn't find the message BTW i just run it on localhost but i've not try yet on a web host i wait for your reply have a good day
PiatPilgrims Inn Interesting, it should work. Can you show me your code?
here is my code sir
Hmm, interesting, it should work. Try to change this line:
echo"something Wrong";
To this:
echo $mail->ErrorInfo;
And let me know what you see. :)
Its a same problem sir it display mail sent but i do not receive any mail i think the problem is in my server thanks for your help sir i think i'm going for a lower version of xampp have a good day sir.. may i ask you a request? can you please make a video tutorial for how to send a sms using php
hi, you do make website?
Yes