2016-03-17 60 views
0

我试图让我的PHP要发送的现在的工作很好,但现在即时通讯试图它与它的配件,其已经在服务器上,所以没有参与上传工作的电子邮件。但是,当我运行它,我得到这个致命的错误: Fatal error: Call to undefined function addattachment() in /home3/hutch/public_html/Murphy/EmailerTest.php on line 19所以我假设我正在写的addAttachemnt($path);$path不正确。有人可以帮我解决这个问题吗?电子邮件附件致命错误

<?php 
require("class.phpmailer.php"); 
require("class.smtp.php"); 

$path = "<IMAGES/Logo.jpg>"; 

$mail = new PHPMailer(); 

$mail->IsSMTP(); // telling the class to use SMTP 
$mail->Host  = "smtp.sulmaxmarketing.com"; // SMTP server 

$mail->From  = "[email protected]"; 
$mail->FromName = "Murphy's Online Documentation System"; 
$mail->AddAddress("[email protected]"); 

$mail->Subject = "Senior Managers Site Tour"; 
$mail->Body  = "You've just recieved an document via the Murphy's Senior Managers Site Tour website.\n Your document is in the attachments"; 
$mail->WordWrap = 50; 
AddAttachment($path); 

if(!$mail->Send()) { 
echo "<font color='#009900' align=centre> ERROR: Something has gone wrong, please contact the site administrator.</font>"; 
} 

else { 
echo "<font color='#CC0033' align=centre>SUCCESS: You're Senior Managers Site Tour document has been sent.</font>"; 
} 

?> 
+0

PHP是告诉你,函数不存在。 AddAttachment定义在哪里?您需要编写该功能并使其执行某些操作。它应该是'$ mail-> AddAttachment()'? – mkaatman

回答

0

好了所有的固定忘记添加$mail->AddAttachment($path);然后最后整理出$path的位置,这一切现在工作的梦想。