problem in smtp mail send

Hi, i use phpmailer extension for smtp mail but mail not sent and for simple mail function is too slow, it takes around 2 mins for redirect and mailing.

actually when i use $mail->IsSMTP(); it not sent mail and when i use $mail->IsMail(); it works but process is too slow…

i set host,uname,pass in phpmailer file and my code is like below,

Yii::import(‘application.extensions.mailer.phpmailer.JPhpMailer’);

			$mail = new JPhpMailer;


			$mail->IsMail();


			$mail->SMTPAuth = true;


		        $mail->SetFrom($fromEmail, $fromName);


			$mail->Subject = $subject;


			$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!';


			$mail->MsgHTML($message);


			$mail->AddAddress($empEmail, $empName);


			$mail->Send();

Follow the link it solves my issue. I have created common function so you can able to use it in all application

Click Here