Pavan G S
Pavan G S

Reputation: 101

Issues with php mailer in Godaddy c-panel

Below code is working fine in localhost But in Godaddy
server(c-panel) recipient didn't receive any mail

require_once('PHPMailer-master/PHPMailerAutoload.php');
$mail = new PHPMailer;
$mail->SMTPDebug = 2;                        // Enable verbose debug output
$mail->isSMTP();                            // Set mailer to use SMTP 
$mail->Host = 'smtp.gmail.com';             // Specify main and backup SMTP 
                                            // servers
$mail->SMTPAuth = true;                       // Enable SMTP  authentication
$mail->Username = '[email protected]';  // SMTP username
$mail->Password = '*********';                   // SMTP password
$mail->SMTPSecure = 'tls';                   // Enable TLS encryption, ssl` also accepted
$mail->Port = 587;                               // TCP port to connect to
$mail->setFrom('[email protected]', 'Social Media');
$mail->addAddress($email);                       // Add a recipient
$mail->addReplyTo('[email protected]', 'Social Media');
$mail->isHTML(true);                             // Set email format to HTML
$mail->Subject = $subject;
$mail->Body    = $message;  
$mail->AltBody = $message;
$mail->Send();

Upvotes: 1

Views: 48

Answers (1)

RigidBody
RigidBody

Reputation: 664

GoDaddy's outgoing SMTP with SSL is port 465. Yes, officially deprecated, but look here, they still use it.

Upvotes: 1

Related Questions