Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class 'SendGrid\Mail\Mail' not found in Codeigniter 4 application #1091

Open
samwoodchs opened this issue Apr 13, 2022 · 1 comment
Open

Comments

@samwoodchs
Copy link

Issue Summary

Receiving "Class 'SendGrid\Mail\Mail' not found " when using sendgrid-php.

I have installed the sendgrid-php into my Codeigniter system by downloading the zip and placing it in a folder in my application. I'm not using composer. I have included the library path as specified and can confirm the path is absolutely correct. However I can not get around the error appearing. This happens both on localhost and on a live server.

I have tested changing permission - even to 777 on the sendgrid-php folder and still no luck.

Code

require(FCPATH."assets/libs/sendgrid-php/sendgrid-php.php");
$email = new \SendGrid\Mail\Mail();

Technical details:

  • codeigniter version: 4
  • sendgrid-php version: 7
  • php version: 7.4.28
@jtowett89
Copy link

Hey! I had the same issue. I noticed that "sendgrid-php.php" requires the "vendor" folder which has "autoload.php". Here it's not present. try getting it from here https://github.com/sendgrid/sendgrid-php/releases/tag/7.11.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants