So I am using the PHPMailer library in PHP to send a welcome email when ever my users registered, and it takes so long to do this.
It takes around 30 - 50 seconds to act
Don't know if PHPMailer is compulsory for you or not, but if it's not I am recommanding SwiftMailer .
as per my personal Experience It's Really fast and reliable.
Thanks.
include_once "inc/swift_required.php";
$subject = 'Hello from Jeet Patel, PHP!'; //this will Subject
$from = array('jeet@mydomain.com' =>'mydomain.com'); //you can use variable
$text = "This is TEXT PART";
$html = "This IS HTML";
$transport = Swift_SmtpTransport::newInstance('abc.xyz.com', 465, 'ssl');
$transport->setUsername('MYUSERNAME@MYDOMAIN.COM');
$transport->setPassword('*********');
$swift = Swift_Mailer::newInstance($transport);
$to = array($row['email'] => $row['cname']);
$message = new Swift_Message($subject);
$message->setFrom($from);
$message->setBody($html, 'text/html');
$message->setTo($to);
$message->addPart($text, 'text/plain');
if ($swift->send($message, $failures))
{
echo "Send successfulllyy";
} else {
print_r($failures);
}