Reply to trying to get phpmail to send an attachment

Your name:

Reply:


Posted by "Ross" on 08/24/05 20:39

I get an error saying


Fatal error: Function name must be a string in
c:\Inetpub\wwwroot\ssn\php_mail.php on line 11


the code

---------------------------------------



<?php

if (isset($submitted)){
echo "hello";
require("class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.blue-fly.co.uk"; // SMTP server
$mail->From = "ross@blue-fly.co.uk";
$mail->AddAddress("ross@aztechost.com");
$mail->AddAttachment($_FILES('userfile'));
$mail->Subject = "first mailing";
$mail->Body = "hi ! \n\n this is First mailing I made myself with PHPMailer
!";
$mail->WordWrap = 50;

if(!$mail->Send())
{
echo "Message was not sent";
echo "Mailer Error: " . $mail->ErrorInfo;
}
else
{
echo "Message has been sent";
}
}
?>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<form name="form1" enctype="multipart/form-data" method="post" action="<?
$PHP_SELF; ?>">
<p>
<input name="userfile"]" type="file" id="userfile">
</p>
<p>&nbsp;</p>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="submitted">
</p>
</form>
</body>
</html>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация