Menu

#1 format bad in outlook (plan txt)

Closed
closed
None
2024-02-16
2024-02-15
Kevin
No

Version 2024.1.2.1

try
        {
            $mail = new PHPMailerPro();
            $recipient = ["kevin@na7kr.us"=>'$call']; // [$COL_EMAIL=>'$call'];
            $sender    = [$senderemail=>'QSL CARD'];
            $mail->SetSender($sender);
            $mail->AddRecipient($recipient);
            $mail->subject     = "Thanks for QSO";
            //$mail->messageText = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
            $body = "<h1>Dear " . $call . "</h1><br>";
            $body .= "Thanks for the recent QSO.<br><br>";
           attach", "$call-$COL_PRIMARY_KEY.jpg");
            $mail->messageHTML = $body .'<br><This message uses HTML entities!br>';
            $mail->AddAttachment("../cards/$call-$COL_PRIMARY_KEY.jpg" , "$call.jpg" ); // attachment
            if ($mail->Send('sendmail')) ;
        }

        catch (Exception $e)
        {
            echo $e->errorMessage();
        }
1 Attachments

Discussion

  • Kevin

    Kevin - 2024-02-15

    Looks ok on iphone, GMAIL page.
    But if download with 365 it does not look OK from gmail or my main email.

    but if sent to Exchange 365 mail box it is OK in outlook.

    So looks like imap or pop3 does not like it.

     
  • Andy Prevost (CodeworxTech)

    Thanks for reporting that Kevin.
    I have not been able to replicate your issue ... however, I am aware there have been recent changes where some providers have configuration settings that alter the use of line endings. That affects mainly *nix servers.
    I am working on an alternate method to generate email headers and body so that it works on all version. It's in process now, hopefully will have a new version to overcome this issue.
    Thanks,
    Andy

     
  • Kevin

    Kevin - 2024-02-15

    work ok without $mail->AddAttachment("../cards/$call-$COL_PRIMARY_KEY.jpg" , "$call.jpg" ); // attachment

     
  • Andy Prevost (CodeworxTech)

    Any attachments, inline or files, adds to the header as well as the body.
    I have a potential fix, may I email it to you to test?
    Thanks
    Andy

     
  • Kevin

    Kevin - 2024-02-15

    Yes please

     
  • Andy Prevost (CodeworxTech)

    Sent. After you test, please post your results here in the "tickets" section so others can be aware of the issue.
    Thanks,
    Andy

     
  • Kevin

    Kevin - 2024-02-15

    no

    --P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y9Db25maXJtYXRpb25zLCBwbGVhc2UgIG9wdGlvbmFsbHkgT3B0IE91dCBvZiBmdXR1cmUgZW1haWxzIDxhIGhyZWY9Imh0dHBzOi8vcXNsLm5hN2tyLnVzXG9wdG91dC5waHAiPk9QVE9VVDwvYT48YnI+PFRoaXMgbWVzc2FnZSB1c2VzIEhUTUwgZW50aXRpZXMhPGJyPg==

     
  • Kevin

    Kevin - 2024-02-15

    if remove
    //$mail->AddAttachment("../cards/$call-$COL_PRIMARY_KEY.jpg" , "$call.jpg" );
    and add
    $mail->AddEmbeddedImage("../cards/$call-$COL_PRIMARY_KEY.jpg", "my-attach", "$call-$COL_PRIMARY_KEY.jpg");

    it add a attachment OK and format looks good

     
  • Andy Prevost (CodeworxTech)

    Are you trying to add the image that is part of the HTML body?
    There is no need to do that, the class will add the embedded image automatically ...

     
  • Andy Prevost (CodeworxTech)

    Kevin,
    I made an assumption and upon going over your posts, my assumption was incorrect.
    You are building an email body from database data (or a variable) that contains an image. You were using the AddEmbeddedImage method to get it to display in the email properly.
    Your first attempt was to use AddAttachment, which through an error at the wrong place. The second attempt worked, AddEmbeddedImage.
    On figuring that out, I reworked PHPMailer Pro to detect errors on image attachments, plus solved a riddle that has existed for years.
    That will be in the next release ...
    Thanks again,
    Andy

     
  • Andy Prevost (CodeworxTech)

    • status: open --> closed
    • assigned_to: Andy Prevost (CodeworxTech)
    • Milestone: 1.0 --> Closed
     

Log in to post a comment.