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

Yii::import('ext.sendgrid.SendGrid');

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

$mail = new SendGrid\Mail();

$mail->addTo($model->email)->

	setFrom(Yii::app()->params['adminEmail'])->

	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>');

$sendgrid->smtp->send($mail);



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

\lib

\SendGrid

Mail.php

SendGrid.php

SendGrid_loader.php

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?