Demo Send Email
--------------------------------------------------------------------------------
Kepada : Kamu
Subject : Additive
Pesan : Pesan
Dari : david
Warning: require(PHPMailer5\class.phpmailer.php) [function.require]: failed to open stream: No such file or directory in /home/sloki/user/masterli/sites/masterlink.co.id/www/cgoods/send_email.php on line 40
Fatal error: require() [function.require]: Failed opening required 'PHPMailer5\class.phpmailer.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/sloki/user/masterli/sites/masterlink.co.id/www/cgoods/send_email.php on line 40
send_email.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$nama = isset($_POST['nama']) ? $_POST['nama'] : '';
$email = isset($_POST['email']) ? $_POST['email'] : '';
$telepon = isset($_POST['telepon']) ? $_POST['telepon'] : '';
$subjek = isset($_POST['subjek']) ? $_POST['subjek'] : '';
$comments = isset($_POST['comments']) ? $_POST['comments'] : '';
?>
<?php
// using htmlentities
$newnama= htmlspecialchars($nama, ENT_QUOTES);
$newemail = htmlspecialchars($email, ENT_QUOTES);
$telepon = htmlspecialchars($telepon, ENT_QUOTES);
$newsubjek = htmlspecialchars($subjek, ENT_QUOTES);
$newcomments = htmlspecialchars($comments, ENT_QUOTES);
?>
<h1>Demo Send Email</h1><hr>
Kepada : Kamu <br />
Subject : <?php echo $newsubjek; ?><br />
Pesan : <?php echo $newcomments; ?><br />
Dari : <?php echo $newnama; ?><br />
<?php
require("PHPMailer5\class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'SSL';
$mail->Host = 'smtp.mail.yahoo.com';
$mail->Port = 25;
$mail->Username = 'david_yg20@yahoo.com';
$mail->Password = '*****';
$mail->From='david_yg20@yahoo.com';
$mail->FromName="My site's mailer";
$mail->Body = $newcomments;
$mail->Sender='david_yg20@yahoo.com';
$mail->AddReplyTo("replies@example.com", "Replies for my site");
$mail->AddAddress("plasteezy@yahoo.com");
//$mail->Subject = $subject;
$mail->IsHTML(true);
#$mail->AddAttachment('http://www.branddesignexpress.com/images/homepage_mainimage.jpg', 'homepage_mainimage.jpg');
$mail->AddEmbeddedImage('homepage_mainimage.jpg', 'logoimg', 'homepage_mainimage.jpg');
// attach file logo.jpg, and later link to it using identfier //logoimg$mail->Body = $msg;
$mail->AltBody="This is text only alternative body.";
if(!$mail->Send()){ echo "Error sending: " . $mail->ErrorInfo;
}else{ echo "Letter is sent";
}
?>
</body>
</html>
Line 40: require("PHPMailer5\class.phpmailer.php");
I wonder why it does not work, I already check and the file is there.