Knowledgebase: Email
Sending email (SMTP) using PHPMailer
Posted by Andy Williams, Last modified by Staff Team on 04 September 2006 09:25 AM

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->From = "";;
$mail->FromName = "Your Name";
$mail->Host = '';
$mail->SMTPAuth = true;
$mail->Username = '';
$mail->Password = '********';
$mail->AddAddress("", "His name");
$mail->Subject = "Here is the subject";
$mail->Body = "This is the message body";
echo "email sent";
echo "There was an error sending the message";

4) Replace the parameters

5) Run the test.php

(576 vote(s))
Not helpful

Comments (0)
Post a new comment
Full Name:
CAPTCHA Verification 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).