Skip to main content
Participating Frequently
December 12, 2018
Answered

Dreamweaver does not recognize the command "use"

  • December 12, 2018
  • 1 reply
  • 441 views

I'm using Phpmailer and these two lines must be the first ones in my PHP script:

use PHPMailer\PHPMailer\PHPMailer;

use PHPMailer\PHPMailer\Exception;

Dreamweaver highlights these lines in red.

I'm using Dreamweaver version 11.0

Many thanks

    This topic has been closed for replies.
    Correct answer Nancy OShea

    Are you working with a .php file?  This looks OK to me in Dreamweaver 2019.

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Untitled Document</title>

    </head>

    <body>

    <?php

    use PHPMailer\PHPMailer\PHPMailer;

    use PHPMailer\PHPMailer\Exception;

    ?>

    </body>

    </html>

    1 reply

    Nancy OShea
    Community Expert
    Nancy OSheaCommunity ExpertCorrect answer
    Community Expert
    December 12, 2018

    Are you working with a .php file?  This looks OK to me in Dreamweaver 2019.

    <!doctype html>

    <html>

    <head>

    <meta charset="utf-8">

    <title>Untitled Document</title>

    </head>

    <body>

    <?php

    use PHPMailer\PHPMailer\PHPMailer;

    use PHPMailer\PHPMailer\Exception;

    ?>

    </body>

    </html>

    Nancy O'Shea— Product User & Community Expert
    Participating Frequently
    December 13, 2018

    yes of course, it's a .php file

    it must be the version then, thanks