我是php新手。正在尝试发送有关用户上载的确认。我正在尝试使用php mailer来实现这一点。并有以下代码,但它不起作用。任何帮助都将不胜感激。
<?php
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
echo "1";
require_once('_mailClasses/class.phpmailer.php');
include("class.smtp.php");
$mail = new PHPMailer();
$body = 'There is a new online order. Please check your order folder.';
$mail->IsSMTP();
$mail->Host = "mail.splashoflondon.com";
$mail->SMTPDebug = 2;
$mail->SMTPAuth = true;
$mail->Host = "mail.splashoflondon.com";
$mail->Port = 26;
$mail->Username = "adolphus@splashoflondon.com";
$mail->Password = "correctpassword";
$mail->SetFrom('adolphus@splashoflondon.com', 'Splash of London');
$mail->AddReplyTo("ali@xgreen.co.uk","First Last");
$mail->Subject = "PHPMailer Test Subject via smtp, basic with authentication";
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
$mail->MsgHTML($body);
$address = "ali@xgreen.co.uk";
$mail->AddAddress($address, "John Doe");
$mail->Send();
}
?>