PHPMailer Tutorial: Send an Email via SMTP with GMail

Поделиться
HTML-код
  • Опубликовано: 25 окт 2024

Комментарии • 426

  • @SenaidBacinovic
    @SenaidBacinovic  5 лет назад

    Do you want to become a web developer from scratch??? Check this: bit.ly/devAccelerator

  • @davehayball2007
    @davehayball2007 4 года назад +5

    I’m humbled and appreciative for your flawless assistance. Thanks a million!

  • @apollooverland
    @apollooverland 5 лет назад

    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 !

  • @wiredbeats9058
    @wiredbeats9058 7 лет назад +2

    Your tutorials are absolutely amazing! I don't understand why you aren't more popular? Thanks :)

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад +2

      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

  • @ognjenk5104
    @ognjenk5104 6 лет назад +1

    Živ bio Senaide... vrhunski tutorial.

  • @dariobellotta1606
    @dariobellotta1606 6 лет назад +1

    "Comment out $mail->isSMTP(); on some Hosts to work" Solved my problem, big thanks :)

  • @srikanthambaldhage2268
    @srikanthambaldhage2268 6 лет назад +1

    Your videos/Tutorials are excellent explanation for beginners. Thankyou very much.

  • @benjaminkuijs579
    @benjaminkuijs579 7 лет назад +2

    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.

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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

  • @andreluisdacostapaes1361
    @andreluisdacostapaes1361 6 лет назад +1

    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.

  • @vegitoblue4390
    @vegitoblue4390 6 лет назад +1

    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

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      Yeah, sometimes small things make a huge difference, glad I could help! :)

    • @vegitoblue4390
      @vegitoblue4390 6 лет назад

      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

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      I don't. There isn't any reason why that would happen...

    • @vegitoblue4390
      @vegitoblue4390 6 лет назад

      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

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад +1

      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!

  • @legkulas
    @legkulas 7 лет назад +1

    just the tutorial I'm looking so straight forward thank you very much

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Awesome, I am so happy that I could help you. :)

  • @somnathghosh9602
    @somnathghosh9602 6 лет назад +1

    Learned a lot fro this video, thanks a lot and I appreciate your efforts for making this such an awesome video lecture.

  • @laszlocsoka2814
    @laszlocsoka2814 6 лет назад +1

    THANK YOU. This is a very cool tutorial video. This is THE tutorial video. Everything is clear. Thanks again

  • @GrupoINTIWeb
    @GrupoINTIWeb 6 лет назад +1

    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"

  • @younesfr85
    @younesfr85 5 лет назад +1

    Great work, thank you very much

  • @ifeanyinnaemego
    @ifeanyinnaemego 4 года назад

    Pls which hosting company can I use to easily set this up cos I am having issues with the current hosting that am using

  • @rhedondeluna2010
    @rhedondeluna2010 4 года назад

    Thank you for this tutorial. It really helped me a lot!

  • @profwtelles
    @profwtelles 6 лет назад

    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

  • @rukundoagira6364
    @rukundoagira6364 5 лет назад +1

    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

    • @SenaidBacinovic
      @SenaidBacinovic  5 лет назад

      PHPMailer is the best, and you can use it to send an email from localhost.

  • @zainaboladiti8540
    @zainaboladiti8540 6 лет назад

    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?

  • @fluffy6741
    @fluffy6741 7 лет назад +1

    Awesome! it work. Thank you so much!

  • @Ruhgtfo
    @Ruhgtfo 6 лет назад

    you the best tutor

  • @SonnyBurnett2012
    @SonnyBurnett2012 4 года назад

    I want to see a video about phpmailer+contact form+google recaptcha+ajax+warning messages for empty or not correctly filled fields.

  • @aongei2815
    @aongei2815 4 года назад +1

    Thank you very much, it's work. :)

  • @yaseenimuhammadraja9461
    @yaseenimuhammadraja9461 3 года назад

    Can add toggle button for hiding and showing html table within mail body using phpmailer???
    Or any another way

  • @TechMaxedYT
    @TechMaxedYT 6 лет назад +1

    It works! Thanks so much!

  • @howardhung6778
    @howardhung6778 5 лет назад +2

    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

  • @jakestormoen9376
    @jakestormoen9376 5 лет назад

    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

    • @SenaidBacinovic
      @SenaidBacinovic  5 лет назад

      Thank you. I have already a tutorial that will answer both questions that you have:
      ruclips.net/video/Mw_ORXPoogY/видео.html

  • @DCodeMania
    @DCodeMania 6 лет назад

    Not working when I upload it on hosting then open my domain then nothing is showing???

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      Are you using the same code? Have you made any changes?

  • @andrewgunn967
    @andrewgunn967 6 лет назад

    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.

  • @danielyobo5096
    @danielyobo5096 6 лет назад

    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

  • @oscarpineda6514
    @oscarpineda6514 6 лет назад +7

    hi , your video it's excelent but in this moment PHPMailler was updated, and i would like you to update your video , thanks

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад +1

      Hi, thank you for the feedback. Here is updated version: ruclips.net/video/-J9k4m1yhco/видео.html :)

    • @lehrlingeeits8635
      @lehrlingeeits8635 6 лет назад

      Thanks for your great work!!

  • @rushdimohamed6963
    @rushdimohamed6963 5 лет назад

    do you have a video of configuring aws to send a mail through php (with windows server 2012 wamp)

  • @systerpp7811
    @systerpp7811 6 лет назад +1

    Thank you so much!!!

  • @rubelrana304
    @rubelrana304 7 лет назад +1

    really nice and clean tutorial

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      thank you :)

    • @rubelrana304
      @rubelrana304 7 лет назад +1

      I am from Bangladesh.. I know about Bosnia , your country. from my childhoood :)

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Oh, nice! From childhood? That's interesting, how? :)

    • @rubelrana304
      @rubelrana304 7 лет назад

      Can you tell me what should i configure for Wamp server, to run your code in local host?

    • @rubelrana304
      @rubelrana304 7 лет назад

      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 :)

  • @raymund2407
    @raymund2407 7 лет назад +1

    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.

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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.

    • @raymund2407
      @raymund2407 7 лет назад +1

      I see, thanks bro. :)

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      It's my pleasure! :D

  • @modurerares298
    @modurerares298 6 лет назад

    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?

  • @SchmittBarghornHund
    @SchmittBarghornHund 6 лет назад +1

    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 ...

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      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

  • @imrulkayes1914
    @imrulkayes1914 5 лет назад

    would you make a update of your video since the library has been updated

  • @hjmagfur5611
    @hjmagfur5611 5 лет назад

    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?

  • @mubsharamin
    @mubsharamin 6 лет назад +1

    thanks owsum video helped me in my project.

  • @nimabahrami422
    @nimabahrami422 5 лет назад +1

    it was very useful thank you sir

  • @Sasha-t7i
    @Sasha-t7i 6 лет назад +1

    0_0 ooooo. Wtf? It is worked! That video is helpful. Thanks

  • @s.mselim1675
    @s.mselim1675 7 лет назад

    very nice and helpful

  • @MatheusHenrique-oy5zd
    @MatheusHenrique-oy5zd 7 лет назад +1

    Works! Thanks man

  • @pianoLee-sx9dx
    @pianoLee-sx9dx 5 лет назад

    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

  • @easyvideott7505
    @easyvideott7505 5 лет назад

    Pozdrav Senaid, jesi probao poslati mail s nasim znakovima "čć" u Subject?

  • @sororbudwiser
    @sororbudwiser 7 лет назад

    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....

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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?

    • @sororbudwiser
      @sororbudwiser 7 лет назад

      Yes. Thank you.

  • @vrajshah2478
    @vrajshah2478 3 года назад

    My google account is denying to send mail. How to activate this feature for my gmail account(which is the mail sender)

  • @zainaboladiti8540
    @zainaboladiti8540 6 лет назад

    I am using xampp as the localhost, is there any configuration I need to do?

  • @SchmittBarghornHund
    @SchmittBarghornHund 6 лет назад

    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!

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      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

  • @ChandeeshKumar
    @ChandeeshKumar 6 лет назад +1

    Thanks, bro!

  • @JovanPoplasen
    @JovanPoplasen 6 лет назад +2

    To Senaide legendo :)

  • @jonathanursua4510
    @jonathanursua4510 7 лет назад +1

    sir how about if u want to use a localhost wampserver? can u make a video tutorial? thanks your tutorials are absolute great. :)

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Thank you! What exactly you would love to learn about wampserver?

  • @narasimhareddy7304
    @narasimhareddy7304 7 лет назад +1

    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

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Do you get any error?

    • @narasimhareddy7304
      @narasimhareddy7304 7 лет назад

      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.

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Obviously you did something wrong in your code. Can yous how it to me?

  • @sonoftroy8572
    @sonoftroy8572 5 лет назад

    Ok but would you need to make any adjustments in the php.ini and sendmail.ini file configuration before starting the code

    • @SenaidBacinovic
      @SenaidBacinovic  5 лет назад

      No, you don't need.

    • @sonoftroy8572
      @sonoftroy8572 5 лет назад +1

      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

    • @SenaidBacinovic
      @SenaidBacinovic  5 лет назад

      Don't stress too much about that, usually all my files are in PHP (except css, js etc.).

  • @СергейОдинцов-ф9я
    @СергейОдинцов-ф9я 5 лет назад

    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!

  • @fruCable
    @fruCable 6 лет назад +1

    Thanks, thanks, thanks!

  • @71GA
    @71GA 7 лет назад +1

    +1 for using Linux!

  • @zulfiqar7967
    @zulfiqar7967 6 лет назад

    can i use my own domain(from Webmail of CPanel) in this phpmailer to send/recieve messages through online server?

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      Yes, absolutely.

    • @zulfiqar7967
      @zulfiqar7967 6 лет назад +1

      Coding Passive Income yea fine. It works. thank you.. Keep updated.. 😉

  • @gencompartit303
    @gencompartit303 4 года назад

    Thanks! 👌

  • @biboylzmusic7171
    @biboylzmusic7171 4 года назад

    what version of phpmailer are you using in this tutorial bruh?

  • @juanantonioreynasaavedra6349
    @juanantonioreynasaavedra6349 6 лет назад +1

    Thank you!

  • @razawebdeveloper
    @razawebdeveloper 6 лет назад

    hello
    have you any tutorial about IMAP, POP3 in php? if not please create it

  • @rk.solo.traveller
    @rk.solo.traveller 6 лет назад

    i think to send a mail from gmail we also need some changes in gmail setting because we are sending mail through gmail server

  • @modurerares298
    @modurerares298 7 лет назад +1

    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

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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.

    • @modurerares298
      @modurerares298 7 лет назад

      I am using dreamhost

    • @modurerares298
      @modurerares298 7 лет назад

      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"

    • @modurerares298
      @modurerares298 7 лет назад

      please sir help me

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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.

  • @afsalmuhammed8627
    @afsalmuhammed8627 5 лет назад

    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

  • @modurerares298
    @modurerares298 7 лет назад +1

    can i use a basic gmail adress like "example@gmail.com" for the $mail->addAddress function?

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Yes, of course. You can use any valid email address.

  • @vivekanandareddy860
    @vivekanandareddy860 6 лет назад

    It's working awesome

  • @zainaboladiti8540
    @zainaboladiti8540 6 лет назад

    Do i habe to include all these in the sign up code ?Please i really need your help

  • @mememoons
    @mememoons 6 лет назад

    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!

  • @argeelearner3978
    @argeelearner3978 6 лет назад +1

    So cool it worked!!!

  • @wahibakamoulcode
    @wahibakamoulcode 6 лет назад +1

    can u do a courses about nodejs ??? thanks

  • @zvoagency332
    @zvoagency332 7 лет назад +1

    Thanks, Bro)

  • @ayushmishra-sw4po
    @ayushmishra-sw4po 6 лет назад

    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

  • @mohsenarab9993
    @mohsenarab9993 5 лет назад

    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.

    • @SenaidBacinovic
      @SenaidBacinovic  5 лет назад

      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

  • @iamflaco3532
    @iamflaco3532 5 лет назад

    Is that filezilla you using to check smtp code?

  • @hirakdeuri1496
    @hirakdeuri1496 5 лет назад

    Brother PHP mailer is not working in live server. But it worls fine in a localhost. Why is it happening?

  • @mohammedhamid5
    @mohammedhamid5 4 года назад

    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?

  • @eanassez3647
    @eanassez3647 7 лет назад

    if the recipients' email is called from the table(xampp), how's the coding ?

    • @SenaidBacinovic
      @SenaidBacinovic  6 лет назад

      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.

  • @timetruth
    @timetruth 6 лет назад

    I get this error escapeshellcmd() was disabled for security reaseon, how can I solve?

  • @rockinpaladin3659
    @rockinpaladin3659 7 лет назад +1

    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 :)

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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.

    • @rockinpaladin3659
      @rockinpaladin3659 7 лет назад +1

      ah i see. thank you so much. this really helps my project :)

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Awesome, I am so happy that I could help you. :)

    • @rockinpaladin3659
      @rockinpaladin3659 7 лет назад

      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

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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?

  • @ladiacona
    @ladiacona 7 лет назад +1

    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!

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад +1

      Hi, all I need is to see your code. Also, are you trying to send an email from your localhost or from some hosting?

    • @ladiacona
      @ladiacona 7 лет назад +1

      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-------------------------------------------------------

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      Can you try to remove this line: $mail->isSMTP(); ?

    • @ladiacona
      @ladiacona 7 лет назад

      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?

    • @hichamelaoula8536
      @hichamelaoula8536 7 лет назад +3

      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.

  • @demetriosarcolakis4821
    @demetriosarcolakis4821 6 лет назад +1

    Very useful! Is the same settings for G Suite?

  • @itoavsegroup8770
    @itoavsegroup8770 7 лет назад +1

    on the latest package, PHPMailerAutoLoad.php is no longer present.

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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

  • @profwtelles
    @profwtelles 6 лет назад

    I modified:
    echo "Somethig is wrong: ".$mail->ErrorInfo;
    The error:
    Somethig is wrong: Could not instantiate mail function.

  • @poojapoojapp3457
    @poojapoojapp3457 7 лет назад +1

    Great content sir... But one doubt, how to attach an uploaded file in the mail?

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      You can see how I am doing it on 12:25 of this video. Is that what you mean?

    • @poojapoojapp3457
      @poojapoojapp3457 7 лет назад +1

      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...

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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

    • @poojapoojapp3457
      @poojapoojapp3457 7 лет назад +1

      Ok, sir. Let me try n get back to you

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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. :)

  • @profwtelles
    @profwtelles 6 лет назад

    I fixer DEPRECATED...but nothing about send email....
    Changed:
    function __autoload($classname)
    {
    PHPMailerAutoload($classname);
    }
    To:
    spl_autoload_register(function($class) {
    PHPMailerAutoload($classname);
    });

  • @salvador-fernandes
    @salvador-fernandes 6 лет назад

    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

  • @codewithraj9517
    @codewithraj9517 7 лет назад +1

    very nice

  • @Sirmulo1
    @Sirmulo1 5 лет назад

    Dose not work with a local server like XAMPP.

  • @furqanwaseem2116
    @furqanwaseem2116 7 лет назад +1

    Sir your code is working no error takes place but didn't send mail to email address.Please resolve my problem as soon.

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад +1

      Are you trying to send an email from the localhost or from the web hosting?

    • @furqanwaseem2116
      @furqanwaseem2116 7 лет назад

      Sir , i am using local host..

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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).

    • @furqanwaseem2116
      @furqanwaseem2116 7 лет назад

      thsi is my error Sir,
      echo SMTP connect() failed. github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

    • @furqanwaseem2116
      @furqanwaseem2116 7 лет назад

      May i send my code to you on your email.?

  • @peterkim9696
    @peterkim9696 7 лет назад +3

    you are awesome bro

  • @paimon2k
    @paimon2k 6 лет назад

    still not receive any mail from gmail.. :(

  • @argeelearner3978
    @argeelearner3978 6 лет назад

    does this work from localhost xampp? or does this work only from a server?

  • @mykolagutsuliak7036
    @mykolagutsuliak7036 2 года назад

    What if attachment size is > 25mb ???

  • @jonathanursua4510
    @jonathanursua4510 7 лет назад +1

    is the procedure same when u want to send email through local host in xampp?? thanks sir senaid :)

  • @sawansinha4680
    @sawansinha4680 6 лет назад

    sir , i did the same thing but i got error... i am using xampp.. please help me sir.

  • @PEDRO-os3nr
    @PEDRO-os3nr 7 лет назад +1

    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

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      PiatPilgrims Inn Interesting, it should work. Can you show me your code?

    • @PEDRO-os3nr
      @PEDRO-os3nr 7 лет назад

      here is my code sir

    • @SenaidBacinovic
      @SenaidBacinovic  7 лет назад

      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. :)

    • @PEDRO-os3nr
      @PEDRO-os3nr 7 лет назад

      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

  • @youtubebangla9571
    @youtubebangla9571 6 лет назад

    hi, you do make website?