install on the debian server the following package:
apt-get install libphp-phpmailer
and use it as in the example below:
require("/usr/share/php/libphp-phpmailer/autoload.php"); $mail = new PHPMailer\PHPMailer\PHPMailer(); $mail->IsSMTP(); $mail->SMTPAuth = false; $mail->SMTPSecure = false; $mail->SMTPAutoTLS = false; $mail->Host = ""; $mail->Port = 25; $mail->IsHTML(true); $mail->SetFrom("from@mydomain.tld"); $mail->Subject = "my subject"; $mail->Body = "my body"; $mail->AddAddress("to@anotherdomain.tld"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message has been sent"; }
Recent Comments