Chris,
I am so confused.
attached is the code, please tell me what did i do wrong.
First i dowloaded the
class.phpmailer.php to my c:\temp\phpmailer
then copied the example code to my php script called php.ini
ini_set("include_path", "c:\temp\phpmailer");
require("class.phpmailer.php");
$mail = new phpmailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp1.site.com;smtp2.site.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "jswan"; // SMTP username
$mail->Password = "secret"; // SMTP password
$mail->From = "from@email.com";
$mail->FromName = "Mailer";
$mail->AddAddress("tien.hoang@wcom.com","tien");
$mail->AddAddress("bocau17@yahoo.com"); // optional name
$mail->AddReplyTo("info@site.com","Information");
$mail->WordWrap = 50; // set word wrap
$mail->AddAttachment("/u02/teamnet/html/latin_america/bid_management/temp/"); // attachment
$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Here is the subject";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";
if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent";
when I run it ....there is an error.
Basically, I created a form. there a botton(Browse) and user can pick and choose any files they want in there C , A drive ect...
and hit submit. Then, the administrator will receive the email from the user and also get that file via email which has the file attachment in the email. Please help me out here...Thanks so much Chris.