PHPMailer is an advanced email PHP framework for use on PHP enabled web servers. These instructions will guide you through setting up PHPMailer from CodeWorxTech to use AuthSMTP as an authenticated SMTP server.
IMPORTANT: These instructions are a basic guide to explain the changes needed to the PHPMailer configuration files to use AuthSMTP as an authenticated SMTP server. They are not a guide to a complete or secure setup of PHPMailer, for further instructions on using and securing PHPMailer please see their website - PHPMailer.
Create a file in the same directory called 'authsmtp-test.php' containing only the following code:
Change the following lines:
- 'USERNAME' to your AuthSMTP username
- 'PASSWORD' to your AuthSMTP password
- 'YOU@EXAMPLE.COM' to your email address
- 'YOUR NAME' to your name or company name
Save and upload your authsmtp-test.php file to the same directory as the PHPMailer files.
Open a web browser and view the uploaded authsmtp-test.php file on the Internet.
You should see a message saying "Message has been sent".
This means that AuthSMTP can be used from your web server and you can continue to integrate this into your form / application.
We recommend that when you do, you store the username and password variable definitions in a separate PHP file outside your public web directory and reference back to it. Storing them in a public PHP file is a potential security risk.
Change the value for $mail->SMTPDebug to '2' and re-run the script
Check your web server error logs for issues
Try one of the alternative ports - 23, 25, 26, 2525, 80
Check the username and password that you have entered are correct
Check with your Network Administrator or Hosting company that external access on one of the ports is possible
Check the permissions on the files you have uploaded
Check that you have validated the 'From Address' on your account, you can check or start the validation process by logging into the Control Panel