November 1, 20223 yr Hi ! I want to sendmail from a php script in Apache-PHP. Is it possible ? Sendmail is on unRAID but not in the docker... Is there a way to bridge the docker and unRAID for sendmail?
November 5, 20223 yr use phpmailer. Has nothing to do with unraid. <?php // PHPMailer classes into the global namespace use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; // Base files require '../PHPMailer/src/Exception.php'; require '../PHPMailer/src/PHPMailer.php'; require '../PHPMailer/src/SMTP.php'; // create object of PHPMailer class with boolean parameter which sets/unsets exception. $mail = new PHPMailer(true); try { $mail->isSMTP(); // using SMTP protocol $mail->Host = 'smtp.gmail.com'; // SMTP host as gmail $mail->SMTPAuth = true; // enable smtp authentication $mail->Username = '[email protected]'; // sender gmail host $mail->Password = '234wdef@@$AE'; // sender gmail host password $mail->SMTPSecure = 'tls'; // for encrypted connection $mail->Port = 587; // port for SMTP $mail->setFrom('[email protected]', "Sender"); // sender's email and name $mail->addAddress('[email protected]', "Receiver"); // receiver's email and name $mail->AddCC('[email protected]', 'Person Two'); $mail->Subject = 'Test email'; $mail->Body = 'Hello World.'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { // handle error. echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo; } ?>
November 6, 20223 yr Author Thanks, but : I saw "phpmailer" but composer is needed ? And may be sendmail. But sendmail is not present on Apache-PHP... Edited November 6, 20223 yr by PicPoc
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.