when sending an attachment the file is a temp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When sending  an attachment using phpmail the file I am trying to send
becomes a temp with a stupid name (php13c9.tmp)

Do you know is going on here?? PHP mailer attachemts are for a 'path to
file' which I am trying to provide via a file browse button ($userfile) in a
form.

Many  Thanks,

R


<?php
//$AddAddress =array("ross@xxxxxxxxxxxxx", "ross@xxxxxxxxxxxxxx");
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@xxxxxxxxxxxxxx";
$mail->AddAddress ("ross@xxxxxxxxxxxxx");
$mail->AddAttachment("$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>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux