1<?php
2require("class.phpmailer.php");
3require("class.smtp.php");
4$mail = new PHPMailer();
5$mail->IsSMTP();
6$mail->Host = "mail.davidokwii.com"; // specify SMTP serve
7$mail->SMTPAuth = true; // turn on SMTP authentication
8
9$mail->Username = "test@davidokwii.com"; // SMTP username
10$mail->Password = "my-password"; // SMTP password
11$mail->From = "test@davidokwii.com"; //From Address
12$mail->addCc('test@live.com,'Test Okwii'); //Cc address
13$mail->addBcc('test@yahoo.com','Test OKwii'); //Bcc address
14$mail->FromName = "PHP SMTP Test";
15$mail->AddAddress("test@gmail.com", "David Test"); //To Address
16$mail->AddReplyTo("test@davidokwii.com", "David Test"); //Reply-To Address
17
18$mail->Port = "25"; // SMTP Port
19$mail->WordWrap = 50; // set word wrap to 50 characters
20$mail->IsHTML(false); // set email format to HTML
21$mail->Subject = "Sending a test email";
22$body="
23Hello,
24
25This is a test email
26
27";
28$mail->MsgHTML($body);
29
30if(!$mail->Send()){
31 echo "Mailer Error: " . $mail->ErrorInfo;
32}
33echo $body;
34?>
35