62 lines
2.4 KiB
PHP
62 lines
2.4 KiB
PHP
<?php
|
|
error_reporting(E_ALL);
|
|
echo error_reporting();
|
|
try{
|
|
|
|
// DECODE SUBJECT AND EMAIL FOR SENDING
|
|
//$subject = htmlspecialchars_decode($subject, ENT_QUOTES);
|
|
//$message = htmlspecialchars_decode($message, ENT_QUOTES);
|
|
|
|
// REPLACE VARIABLES IN SUBJECT AND MESSAGE
|
|
//$subject = str_replace($search, $replace, $subject);
|
|
////$message = str_replace($search, $replace, $message);
|
|
|
|
// ENCODE SUBJECT FOR UTF8
|
|
//$subject="=?UTF-8?B?".base64_encode($subject)."?=";
|
|
|
|
// REPLACE CARRIAGE RETURNS WITH BREAKS
|
|
//$message = str_replace("\n", "<br>", $message);
|
|
|
|
require_once('/home/bateworldcom/public_html/mailer/class.phpmailer.php');
|
|
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
|
|
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
|
|
$mail->IsSMTP(); // telling the class to use SMTP
|
|
$mail = new PHPMailer();
|
|
$mail->IsSMTP(); // telling the class to use SMTP
|
|
$mail->Host = "b8world.com"; // SMTP server
|
|
$mail->SMTPAuth = true; // authentication enabled
|
|
//$mail->SMTPSecure = 'ssl';
|
|
$mail->Port = 587;
|
|
//$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
|
|
$mail->Username = "happybirthday@b8world.com"; // SMTP account username
|
|
$mail->Password = "y2sWJ*#h8)xG"; // SMTP account password
|
|
//$mail->From = "mailservices@b8world.com";
|
|
$mail->SetFrom('happybirthday@b8world.com', 'Bateworld');
|
|
$mail->AddReplyTo('happybirthday@b8world.com', 'Bateworld');
|
|
$mail->AddAddress('porembaphilip@gmail.com');
|
|
|
|
$mail->Subject = 'Test of bateworld birthday eamil';
|
|
//$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
|
|
$mail->MsgHTML('Hello, this is the test email');
|
|
//$mail->AddAttachment('mailer/images/phpmailer.gif'); // attachment
|
|
//$mail->AddAttachment('mailer/images/phpmailer_mini.gif'); // attachment
|
|
|
|
$mail->Send();
|
|
|
|
|
|
//echo "Message Sent OK<p></p>\n";
|
|
|
|
//echo "Message Sent OK<p></p>\n";
|
|
} catch (phpmailerException $e) {
|
|
//mail("porembaphilip@gmail.com", "MAIL ERROR", $e->errorMessage());
|
|
echo $e->errorMessage(); //Pretty error messages from PHPMailer
|
|
} catch (Exception $e) {
|
|
echo $e->getMessage(); //Boring error messages from anything else!
|
|
//mail("porembaphilip@gmail.com", "MAIL ERROR", $e->getMessage());
|
|
}
|
|
|
|
echo "check";
|
|
|
|
|
|
//mail("porembaphilip@gmail.com", "MAIL ERROR", "testing message");
|
|
?>
|