===================================================================== TLS and SSL --------------------------------------------------------------------- TLS and SSL are almost same. Over the years vulnerabilities have been and continue to be discovered in the deprecated SSL protocols, so use TLS. --------------------------------------------------------------------- $mail->SMTPSecure = 'tls'; --------------------------------------------------------------------- ===================================================================== About STARTTLS ( doesnot meant TLS only! ) --------------------------------------------------------------------- STARTTLS is a way to take an existing insecure connection and upgrade it to a secure connection using SSL/TLS. Note that despite having TLS in the name, STARTTLS doesn't mean you have to use TLS, you can use SSL. ===================================================================== Transport --------------------------------------------------------------------- a. No need to do anything to use PHP's mail() function b. Execute isSendmail() to use sendmail libraray $mail->isSendmail(); c. Execute isSMTP() to use SMTP protocal $mail->isSMTP(); ===================================================================== Authentication and Encryption --------------------------------------------------------------------- To use authentication, execute $mail->SMTPAuth = true; To use encryption, execute $mail->SMTPSecure = 'tls'; "SMTPSecure" decides which security to use, TLS or SSL. However, it doesn't decide whether or not security is used. It looks like automatic. If the server gives an option of SSL/TLS connection, it uses one. ----------------------------------- CLIENT -> SERVER: STARTTLS ----------------------------------- Then the server returns ----------------------------------- SERVER -> CLIENT: 220 TLS go ahead ----------------------------------- Now the client can sent data in an encrypted mode. If the server doesn't give an option of security, then the client just transmits data without encryption. --------------------------------------------------------------------- //-- No Authentication ( encryption is auto ) $mail->isSMTP(); // Use SMTP $mail->Host = "mail.phpkobo.com"; $mail->Port = 25; $mail->SMTPAuth = false; //-- Authentication ( encryption is auto ) $mail->isSMTP(); // Use SMTP $mail->Host = "mail.devpacc.com"; $mail->Port = 25; $mail->SMTPAuth = true; $mail->Username = "info+devpacc.com"; $mail->Password = "......."; //-- Gmail (Authentication) $mail->isSMTP(); // Use SMTP $mail->Host = 'smtp.gmail.com'; $mail->Port = 587; $mail->SMTPSecure = 'tls'; $mail->SMTPAuth = true; $mail->Username = "phpkobo@gmail.com"; $mail->Password = "......."; =====================================================================