Knowledgebase · Email
Sending email (SMTP) using PHPMailer
Last updated 2020-04-05
1) First of all download the PHP Mailer classes and documentation.
2) Upload both class.smtp.php and class.phpmailer.php to your web space.
3) Create test.php and insert the following code inside the file
<?
require ('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = "mail@domain.com";;
$mail->FromName = "Your Name";
$mail->Host = 'mail.domain.com';
$mail->SMTPAuth = true;
$mail->Username = 'mail@domain.com';
$mail->Password = '********';
$mail->AddAddress("dest@domain.com", "His name");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
if($mail->Send())
{
echo "email sent";
exit;
}
echo "There was an error sending the message";
?>
4) Replace the parameters
5) Run the test.php
2) Upload both class.smtp.php and class.phpmailer.php to your web space.
3) Create test.php and insert the following code inside the file
<?
require ('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->From = "mail@domain.com";;
$mail->FromName = "Your Name";
$mail->Host = 'mail.domain.com';
$mail->SMTPAuth = true;
$mail->Username = 'mail@domain.com';
$mail->Password = '********';
$mail->AddAddress("dest@domain.com", "His name");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
if($mail->Send())
{
echo "email sent";
exit;
}
echo "There was an error sending the message";
?>
4) Replace the parameters
5) Run the test.php
Tell us what you need
Compare available plans or describe your workload so we can discuss a suitable starting point.