0

I've been setting up an email sending system, which I had working perfectly with simple <p> tag and <img> tag but I made it a little more complex just or visual aspects and this has caused it to no longer receive the emails. Does anyone know what I'm mission here?

<?php

require("php/PHPMailer.php");
require("php/SMTP.php");
if (isset($_GET['email'])) {

  $emailID = $_GET['email'];

  if($emailID = 1){
    $mail = new PHPMailer\PHPMailer\PHPMailer();
    $mail->IsSMTP(); // enable SMTP

    $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
    $mail->SMTPAuth = true; // authentication enabled
    $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for Gmail
    $mail->Host = "mail.example.com";
    $mail->Port = 465; // or 587
    $mail->IsHTML(true);
    $mail->Username = "myusername";
    $mail->Password = "mypassword";
    $mail->SetFrom("myemail@example.com");
    $mail->Subject = "Test";
    $mail->Body = '<html><body><img src="https://example.com/images/DocHeader.png" style="margin-left:10%;" width="80%"><br><br><br><div style="margin-left:15%"><p>Date</p><p>Dear,</p><p>Agreement Number: <br>Reg Number: </p><p>We are contacting you to advise that a payment of &pound; due on --/--/-- has not been received.<br>We know this is likely to be an oversight, to keep your account up to-date please make a payment of .<br>If you wish to pay by card or to discuss this matter, please contact our team on 0330 22 33 956.<br>Please be aware failure to make payments as they fall due could result in your rental being terminated. <br><br>Sincerely,<br></p><br><img src="https://example.com/images/sine.jpg" style="width:10%;"><br><br><p>TO MAKE PAYMENT PLEASE USE THE FOLLOWING DETAILS<br><br>Sort Code:  <br>Account No:  <br>Account Name:<br>Reference: </p><br><br><br></div><img src="https://example.com/images/DocFooter.png" style="margin-left:10%;" width="80%"></body></html>';

    $mail->AddAddress("toemail@example.com");

    if(!$mail->Send()) {
        echo "Mailer Error: " . $mail->ErrorInfo;
    } 
    else {
        echo "Message has been sent";
    }
  }
}

?>

This is the output I'm getting:

2018-07-12 15:09:39 CLIENT -> SERVER: EHLO www.example.com

2018-07-12 15:09:39 CLIENT -> SERVER: AUTH LOGIN

2018-07-12 15:09:39 CLIENT -> SERVER:

2018-07-12 15:09:39 CLIENT -> SERVER:

2018-07-12 15:09:39 CLIENT -> SERVER: MAIL FROM:

2018-07-12 15:09:39 CLIENT -> SERVER: RCPT TO:

2018-07-12 15:09:39 CLIENT -> SERVER: DATA

2018-07-12 15:09:39 CLIENT -> SERVER: Date: Thu, 12 Jul 2018 10:09:39 -0500

2018-07-12 15:09:39 CLIENT -> SERVER: To: toemail@example.com

2018-07-12 15:09:39 CLIENT -> SERVER: From: myemail@example.com

2018-07-12 15:09:39 CLIENT -> SERVER: Subject: Test

2018-07-12 15:09:39 CLIENT -> SERVER: Message-ID: <5ni9EmxB1gMebuKPgxwKUifg3IWKC0914eaJ4OjQxUA@www.example.com>

2018-07-12 15:09:39 CLIENT -> SERVER: X-Mailer: PHPMailer 6.0.5 (https://github.com/PHPMailer/PHPMailer)

2018-07-12 15:09:39 CLIENT -> SERVER: MIME-Version: 1.0

2018-07-12 15:09:39 CLIENT -> SERVER: Content-Type: text/html; charset=iso-8859-1

2018-07-12 15:09:39 CLIENT -> SERVER: Content-Transfer-Encoding: quoted-printable

2018-07-12 15:09:39 CLIENT -> SERVER:

2018-07-12 15:09:39 CLIENT -> SERVER: https://example.com/images/DocHeader.png" style=3D"=

2018-07-12 15:09:39 CLIENT -> SERVER: margin-left:10%;" width=3D"80%">


=

2018-07-12 15:09:39 CLIENT -> SERVER:

Date

Dear,

Agreement Number:
Reg Number:

We are c=

2018-07-12 15:09:39 CLIENT -> SERVER: ontacting you to advise that a payment of £ due on --/--/-- has not b=

2018-07-12 15:09:39 CLIENT -> SERVER: een received.
We know this is likely to be an oversight, to keep your ac=

2018-07-12 15:09:39 CLIENT -> SERVER: count up to-date please make a payment of .
If you wish to pay by card o=

2018-07-12 15:09:39 CLIENT -> SERVER: r to discuss this matter, please contact our team on 0330 22 33 956.
Ple=

2018-07-12 15:09:39 CLIENT -> SERVER: ase be aware failure to make payments as they fall due could result in your=

2018-07-12 15:09:39 CLIENT -> SERVER: rental being terminated.

Sincerely,
Nicole Moore.


2018-07-12 15:09:39 CLIENT -> SERVER: rc=3D"https://example.com/images/NicoleSign.jpg" style=3D"width:10%;">
<=

2018-07-12 15:09:39 CLIENT -> SERVER: br>

TO MAKE PAYMENT PLEASE USE THE FOLLOWING DETAILS
Lloyds Bank Plc

2018-07-12 15:09:39 CLIENT -> SERVER: r>
Account No:
Account Name:=

2018-07-12 15:09:39 CLIENT -> SERVER:
Reference: JJR




2018-07-12 15:09:39 CLIENT -> SERVER: g src=3D"https://example.com/images/DocFooter.png" style=3D"margin-left:10%=

2018-07-12 15:09:39 CLIENT -> SERVER: ;" width=3D"80%">

2018-07-12 15:09:39 CLIENT -> SERVER: .

2018-07-12 15:09:39 CLIENT -> SERVER: QUIT

Message has been sent

Matt Hutch
  • 453
  • 1
  • 6
  • 20

0 Answers0