diff --git a/src/bu-command-local-conf.json b/src/bu-command-local-conf.json deleted file mode 100644 index 0f685c6..0000000 --- a/src/bu-command-local-conf.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "Smtp": { - "SMTPDebug": "0", - "Host" : "xhia.com", - "SMTPAuth" : true, - "Username" : "john@pearcey.net", - "Password" : "N0M0r3M4sk5", - "SMTPSecure" : "tls", - "Port" : 587, - "EmailBody_Invite" : "Please click on the <a href='http://localhost:8081/register?s=$secret&email=$email'>link</a> to accept the invitation." - }, - - "Paths" : { - "invite_secrets" : "../data/invite_secret.txt" - } - -} diff --git a/src/test-email.php b/src/test-email.php new file mode 100644 index 0000000..3be71e2 --- /dev/null +++ b/src/test-email.php @@ -0,0 +1,51 @@ +<?php + +require dirname(__DIR__)."/vendor/autoload.php"; + + +use PHPMailer\PHPMailer\PHPMailer; +use PHPMailer\PHPMailer\SMTP; +use PHPMailer\PHPMailer\Exception; + + +testEmail(); + + function testEmail(){ + + //Create an instance; passing `true` enables exceptions + $mail = new PHPMailer(true); + + try { + + //$mail->SMTPDebug = SMTP::DEBUG_SERVER; + $mail->isSMTP(); //Send using SMTP + $mail->Host = 'mail.etradedynamics.ltd'; //Set the SMTP server to send through + $mail->SMTPAuth = true; //Enable SMTP authentication + $mail->Username = 'admin@etradedynamics.ltd'; //SMTP username + $mail->Password = 'wN8iC8zA1f'; //SMTP password + + $mail->SMTPSecure = ''; + $mail->Port = 25; //465,587 ? + $mail->SMTPAutoTLS = false; + + //Recipients + $mail->setFrom('admin@etradedynamics.ltd', 'Mailer'); + $mail->addAddress('john@pearcey.net', 'John Pearcey'); //Add a recipient + + //Content + $mail->isHTML(true); //Set email format to HTML + $mail->Subject = 'Test email from Lars server'; + $mail->Body = 'A <b>test</b> email'; + $mail->AltBody = ''; + + $mail->send(); + echo 'Message has been sent'; + + } catch (Exception $e) { + var_dump($e->getTraceAsString()); + echo "Mailer Error: {$mail->ErrorInfo}\n"; + } + } + + +?>