Sendgrid and Yii

I have this code to word for word from the sendgrid php examples.

When I goto the registration page (before posting any data) I get an http 500.

comment out the $mail = new SendGrid\Mail(); line and it displays the form.

Does not send email…

// Import class


$sendgrid = new SendGrid('uid', 'pswrd');

$mail = new SendGrid\Mail();



	setSubject( UserModule::t("Your registration at {site_name}",array('{site_name}'=>Yii::app()->name)))->

	setText( UserModule::t("To activate your account please go to {activation_url}",array('{activation_url}'=>$activation_url)))->

	setHtml('<strong>Hello World!</strong>');


I have the code in the extensions.sendgrid folder and below that is:






How do I get to the Mail php file???

A little research and I found the issue. Sendgrid PHP code was written in PHP v5.3.n as is using namespaces.

I am still running PHP 5.1.6 and that is the issue.

But,I have php 5.3.10 and still it shows Class ‘SendGrid\Mail’ not found.Any suggestions?