电子邮件附件致命错误

问题描述:

I'm trying to get my php to send an email which works fine now but im now attempting it to work with an attachment with it which is already on the server so there is no upload involved. But when I run it I get this fatal error: Fatal error: Call to undefined function addattachment() in /home3/hutch/public_html/Murphy/EmailerTest.php on line 19 So i'm assuming i'm writing the addAttachemnt($path); or $path incorrectly. Could someone clear this up for me?

<?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     = "info@sulmaxmarketing.com";
$mail->FromName = "Murphy's Online Documentation System";
$mail->AddAddress("sulmaxcp@gmail.com");

$mail->Subject  = "Senior Managers Site Tour";
$mail->Body     = "You've just recieved an document via the Murphy's Senior Managers Site Tour website.
 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>";
}

?>

Okay all fixed forgot to add $mail-> to AddAttachment($path); then lastly sorted out the location of the $path and it all works a dream now.