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,


			$mail = new JPhpMailer;


			$mail->SMTPAuth = true;

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

			$mail->Subject = $subject;

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


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


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

Click Here