0

I have smtp mail function which is worked in local host well but not working in go daddy

Mycode

$mail = new PHPMailer(); // defaults to using php "mail()"
$body = "This is test mail by monirul";
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "ssl";
$mail->Port = 465;
$mail->Username = "webadmin@company.in";
$mail->Password = "password$";
$mail->Host = "chi-node46.websitehostserver.net";
$mail->Mailer = "smtp";
$mail->AddReplyTo("Uname@gmail.com", "Customer Voice");
$mail->SetFrom('Uname@gmail.com', 'Customer Voice');

$address = "test@gmail.com";
$mail->AddAddress($address, "shanu");
$mail->Subject = "Test Invoice";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // option

Got error(Server)

SMTP Error: Could not connect to SMTP host.

Any help would be appreciated.

Shanu k k
  • 1,235
  • 2
  • 18
  • 43

0 Answers0