Topic: Sending email with multiple attachments (Read 2779 times)
Kill the googlebot
Posts: 6
44 credits Members referred : 0
« on: Feb 28, 2007, 12:45:44 pm »
HI again i used the phpmail class Here is the code below but somehow i can't get the attachment with the email. I created a form to select a file from a local drive but its not sending the attachment.
$test = new attach_mailer("Joseph Luong", "diep@chariot.net.au", "diep@chariot.net.au", "copy@provider.com", "blind@copy.org", "Test mime email class subject"); $test->text_body = "...Some body text\n\n the admin"; $test->add_attach_file($_FILES['userfile']['name'],$encoding = "base64", $dispo = "attachment",$type=$_FILES['userfile']['tmp_name']);
$test->process_mail(); ?>
</body> </html>
Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #1 on: Feb 28, 2007, 12:56:03 pm »
first place the php code above the html code (like in the example files)
this example you showed me is for one file...
Kill the googlebot
Posts: 6
44 credits Members referred : 0
« Reply #2 on: Feb 28, 2007, 01:12:46 pm »
HI
yes i changed the code. But still it is not attaching the file i upload. if i change it to below $test->add_attach_file($_FILES['userfile']['tmp_name']);
instead of $test->add_attach_file($_FILES['userfile']['name']);
then it attaches but doesn't have the correct filename.
<?php include_once("attach_mailer_class.php");
if(isset($_FILES['userfile']['tmp_name'])){ print_r($_FILES); $test = new attach_mailer("Joseph Luong", "diep@chariot.net.au", "diep@chariot.net.au", "copy@provider.com", "blind@copy.org", "Test mime email class subject"); $test->text_body = "...Some body text\n\n the admin"; //$test->add_attach_file($_FILES['userfile']['name'],$encoding = "base64", $dispo = "attachment",$type=$_FILES['userfile']['tmp_name']); //$test->add_attach_file('ip2nation.zip'); $test->add_attach_file($_FILES['userfile']['name']); $test->process_mail(); }