Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error: syntax error, unexpected 'use' (T_USE) #1142

Closed
eddiejibson opened this issue Sep 3, 2017 · 1 comment
Closed

Parse error: syntax error, unexpected 'use' (T_USE) #1142

eddiejibson opened this issue Sep 3, 2017 · 1 comment

Comments

@eddiejibson
Copy link

eddiejibson commented Sep 3, 2017

Problem description

I've always sent from PHPMailer with ease, it always works well. However, after updating to the newer version, I ran composer install within the PHPMailer directory and then ran composer require phpmailer/phpmailer within the directory my functions file is at, which sends the email. Hoping this would work well. However, when I used the example to try and send a test email, an error arose: Parse error: syntax error, unexpected 'use' (T_USE) I don't understand what went wrong.

Code to reproduce

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

I then required once the autoload file which loaded fine.

Any ideas?

@eddiejibson
Copy link
Author

Nevermind, it was inside a function instead of at the top of the PHP file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants