Search code examples
phpcomposer-phpphpmailervendor

i want to use phpmailer.for that i have installed composer,but still autoload file is missing


I have installed composer successfully.but when i am trying to run code of phpmailer its showing me following error.and also i am unable to find vendor\autoload file and folder in my machine.


( ! ) Warning:require(vendor/autoload.php): failed to open stream: No such file or directory in C:\wamp\www\mail.php on line 8


Solution

  • First Install Composer from this link. Then install it to your system. after installation open the command prompt and go to your project dir then use this command

    composer require phpmailer/phpmailer
    

    and you'll get a vendor directory in your project dir with phpmailer inside it. after that I guess you can figure out how to use it on your own or check the documentation