This article only concerns with Shared and Reseller hosting packages on our server. We do not support any external SMTP servers to send email from our Shared and Reseller hosting accounts. You need to use our hosting servers to send emails using SMTP.
Follow the steps below to send SMTP emails from your shared/reseller server.
Install PHPMailer using composer
- Login to your account using SSH and go to the root of your application directory.
- Type composer require phpmailer/phpmailer
Test the installation
- Create a file to test the installation of the composer package
user@server [~/public_html] vi mailtest.php
- paste the following code in the file you created above
<?php use PHPMailer\PHPMailer\PHPMailer; require 'vendor/autoload.php'; $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = gethostname(); $mail->SMTPAuth = true; $mail->Username = 'sender@example.com'; $mail->Password = 'password'; $mail->setFrom('sender@example.com'); $mail->addAddress('recipient@example.com'); $mail->Subject = 'Email subject'; $mail->Body = 'Email body'; $mail->send(); ?>
- Test the setup by running the file from the command line
user@server [~/public_html] php mailtest.php
Please note that our shared and reseller hosting has a limitation of 500 emails per hour and 1000 emails per day. We do not support bulk mail through our servers. Please contact us if you have more requirements for email services.