电子邮件附件致命错误
Email attachment Fatal Error
我正在尝试让我的 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 = "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.\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>";
}
?>
好吧,所有问题都解决了忘记添加 $mail->
到 AddAttachment($path);
,然后最后整理出 $path
的位置,现在一切都在做梦。
我正在尝试让我的 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 = "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.\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>";
}
?>
好吧,所有问题都解决了忘记添加 $mail->
到 AddAttachment($path);
,然后最后整理出 $path
的位置,现在一切都在做梦。