Gmail woes....

Could someone please advise me on how to get a lower level of debugging when it comes to the outbouand mail server ?

Im using Gmail but consistently get the error “[FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails.”

Now i have configured it as best as i can and just to prove my server can send emails i have the following PHP script that works but the exact same settings in Suitecrm fail. Ive even added the “options array” into the connect function of “class.smtp.php” but no luck.

FYI Version 7.7.5
Sugar Version 6.5.24 (Build 509)

<?php
require("/usr/local/share/phpmailer/class.phpmailer.php");
require("/usr/local/share/phpmailer/class.smtp.php");
 


$mail = new PHPMailer(true); // create a new object
$mail->IsSMTP(); // enable SMTP
	$mail->SMTPDebug = 1;  // debugging: 1 = errors and messages, 2 = messages only
	$mail->SMTPAuth = true;// authentication enabled
	$mail->Host = 'smtp.gmail.com';
	$mail->Port = 587;
	$mail->SMTPAutoTLS = true;
	$mail->SMTPOptions = array(
    'ssl' => array(
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
    )
);
	$mail->Username = '*******@gmail.com';  
	$mail->Password = '*********;           
	$mail->SetFrom('applications@motion-solutions.com.au');
	$mail->Subject = 'test';
	$mail->Body = 'hello';
	$mail->AddAddress('matthew@motion-solutions.com.au');
	if(!$mail->Send()) {
		$error = 'Mail error: '.$mail->ErrorInfo; 
		return false;
	} else {
		$error = 'Message sent!';
		return true;
	}
 ?>

Hi,
I know in the past I’ve had issues sending email from Gmail from Suite until I enable the access for less secure apps option in Gmail. This page should talk you through enabling it:

https://support.google.com/accounts/answer/6010255?hl=en

Hope that helps.