Hi
I have installed and enabled csf after it i can't send email by gmail smtp server when i disable csf it is correct
php mail function:
open ports in csf config
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2222,57241"
# Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,53,80,110,113,443,465,2222"
what is issue? how i can fix it?
Thank you,
best regards.
I have installed and enabled csf after it i can't send email by gmail smtp server when i disable csf it is correct
php mail function:
PHP:
function smtpmailer($to, $from, $from_name, $subject, $body) {
global $error;
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = GUSER;
$mail->Password = GPWD;
$mail->SetFrom($from, $from_name);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);
if(!$mail->Send()) {
$error = 'Mail error: '.$mail->ErrorInfo;
return false;
} else {
$error = 'Message sent!';
return true;
}
}
open ports in csf config
# Allow incoming TCP ports
TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,995,2222,57241"
# Allow outgoing TCP ports
TCP_OUT = "20,21,22,25,53,80,110,113,443,465,2222"
what is issue? how i can fix it?
Thank you,
best regards.