ok
Direktori : /home2/selectio/www/mm-tailor-billing/hrm/mail/send-email/ |
Current File : /home2/selectio/www/mm-tailor-billing/hrm/mail/send-email/mail.php |
<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\SMTP; require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; $mail = new PHPMailer(true); try { $mail->SMTPDebug = 2; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'ssl://smtp.gmail.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'brindha36brindha36@gmail.com'; // SMTP username $mail->Password = 'fddthshvmqqtmeta'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, [ICODE]ssl[/ICODE] also accepted $mail->Port = 465; // TCP port to connect to $mail->setFrom('brindha36brindha36@gmail.com', 'Mailer'); $mail->addAddress('musthafa.md727@gmail.com', 'Joe User'); // Add a recipient $mail->addAddress('musthafa.md127@gmail.com'); // Name is optional $mail->addReplyTo('info@example.com', 'Information'); $mail->addCC('cc@example.com'); $mail->addBCC('bcc@example.com'); //Content $mail->isHTML(true); //Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body <b>in bold!</b>'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { error_log($e); echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } ?>