jcadima
5/12/2016 - 2:45 PM

Godaddy PHP Mailer SMTP issues

Godaddy PHP Mailer SMTP issues

http://stackoverflow.com/questions/21841834/phpmailer-godaddy-server-smtp-connection-refused


<?php
/*
Use the following for sites hosted on goaddy

*/


  $mail = new PHPMailer();
	$mail->IsSMTP();          
	// $mail->SMTPDebug  = 3;
	$mail->Debugoutput = 'html';
	// $mail->Host = "smtp.gmail.com";
	// $mail->Host = "smtp.secureserver.net";
	$mail->Host = "localhost";

	// $mail->Port = 465;       
	$mail->IsHTML(true);   
	// $mail->SMTPSecure = "";
	$mail->SMTPAuth   = true; 
// Create a godaddy email account:
	$mail->Username = 'admin@fr44insurance.xyz'; 
	$mail->Password = 'admin@fr44';      


	$mail->SetFrom($email , $firstname);         
	$mail->Subject = 'New Message' ;
	//$mail->MsgHTML($body);
	
	$address = 'juan@popcreativegroup.com';  // SEND TO THIS ADDRESS
	$mail->AddAddress($address, "FR44 Admin");
	$mail->Body = $msg;
	
	if (!$mail->Send()) {
		$mesaj = 'The message cannot be delivered, please try again later!' .$mail->ErrorInfo;
		//echo $mesaj;
		// exit();
	} else {
		$mesaj = 'Thank you for getting in touch. We will contact you!';
		 wp_redirect( get_permalink( get_page_by_title( 'Thank You' ) ), 200 );
		// header("Location: http://sr22insure.xyz/thank-you/") ;
       //  exit;
		//echo $mesaj ;
		// exit();
	}