attachment problem [ SOLVED ! ] => php mail with attachme

the mail() function

Moderators: macek, egami, gesf

imbolc
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Aug 16, 2004 7:58 am
Contact:

attachment problem [ SOLVED ! ] => php mail with attachme

Postby imbolc » Mon Aug 16, 2004 8:06 am

hey, i had a script to send email with attachments, but at some point a strange problem occured. It can send multiple files with the email, but the first one seems to come "in-line" in the recieved email, while the next files arrive as real, working attachments... i have no idea where the problem lies. any ideas?

mail.php

Code: Select all

<?php

// Read POST request params into global vars
$to      = '******@hotmail.com';
$from    = $_POST['from'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$naam    = $_POST['name'];

// variables to set
$max_uploads = 4; // set the max number of uploads
$redirect_url = "http://ibis.studentenweb.org/scouts/leiding/gelukt.html"; // where to redirect after the email
$allowed_extensions = ".gif .jpg .jpeg .exe .png .doc .pdf .txt .html. css .ppt .xls .zip .rar"; // the file types that can be uploaded
$max_size = "1024000"; // maximum file size (in bytes)

// set the from header
$headers = "From: $from";

// Generate a boundary string
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
      "Content-Type: multipart/mixed;\n" .
      " boundary=\"{$mime_boundary}\"";
       
// process each file
$cur = 1;
$message_errors = "";
$message_tmp = "";
while ($max_uploads >= $cur) {

    if (is_uploaded_file($_FILES["fileatt$cur"]['tmp_name'])) {
     
        // find the extension
        $extension = strtolower(strrchr($_FILES["fileatt$cur"]['name'],"."));
        if (substr_count($allowed_extensions,$extension) == 1) {
         
            // check size
            $size = filesize($_FILES["fileatt$cur"]['tmp_name']);
            if ($size < $max_size) {
             
                $fileatt[$cur]      = $_FILES["fileatt$cur"]['tmp_name'];
                $fileatt_type[$cur] = $_FILES["fileatt$cur"]['type'];
                $fileatt_name[$cur] = $_FILES["fileatt$cur"]['name'];
                 
                $file = fopen($fileatt[$cur],'rb');
                $data = fread($file,filesize($fileatt[$cur]));
                fclose($file);
                 
                // Base64 encode the first file data
                $data = chunk_split(base64_encode($data));
                 
                // Add the file attachment to the message
                $message_tmp .= "--{$mime_boundary}\n" .
                          "Content-Type: {$fileatt_type[$cur]};\n" .
                          " name=\"{$fileatt_name[$cur]}\"\n" .
                          //"Content-Disposition: attachment;\n" .
                          //" filename=\"{$fileatt_name.$cur}\"\n" .
                          "Content-Transfer-Encoding: base64\n\n" .
                          $data;
             
            } else {
             
                $message_errors .= "\n The file " . $_FILES["fileatt$cur"]['name'] . " was not attached because it is bigger than the maximum file size allowed.";
                 
            }
                       
        } else {
         
            $message_errors .= "\n The file " . $_FILES["fileatt$cur"]['name'] . " was not attached because this file extension has been blocked.";
         
        }
                   
    }
         
    $cur++;
     
}

// Add a multipart boundary above the plain message
$message = "This is a multi-part message in MIME format.\n\n" .
     "--{$mime_boundary}\n" .
     "Content-Type: text; charset=\"iso-8859-1\"\n" .
     "Content-Transfer-Encoding: 7bit\n\n" .
     $message;

     
if ($message_errors <> "") {
    $message .= "\n\n~~~~~~~~~~~~~~~~~~~~~~~~~" . $message_errors;
}

$message .= "\n\n";

$message .= "\n\n\n\n\n";
$message .= "____________________________________\n";
$message .= "Deze email komt van de leidingssite.";
$message .= $message_tmp;



// Send the message
$ok = @mail($to, $subject, $message, $headers);
if ($ok) {
  header("Location: $redirect_url");
} else {
  echo "<p>Mail could not be sent. Sorry!</p>";
}

?>


mail.html

Code: Select all

<FORM name=a method="POST" action="mail.php" enctype="multipart/form-data">
<p>
<table borderwidth=0>
 <tr><td>Uw naam: </td><td><input type="text" name="name" value="" maxlenght="80" size="50" /></td></tr>
 <tr><td>Uw email: </td><td><input type="text" name="from" value="" maxlenght="80" size="50" /></td></tr>
 <tr><td>Onderwerp: </td><td><input type="text" name="subject" value="" maxlenght="80" size="50" /></td></tr>
<tr><td colspan="2">Bericht:</td></tr>
<tr><td colspan="2"><textarea cols="70" rows="20" name="message"></textarea></p>
<tr>
 <td>File Attachment: </td><td><input type="file" name="fileatt1" size="35"/></td>
</tr>
<tr>
 <td>File Attachment: </td><td><input type="file" name="fileatt2" size="35"/></td>
</tr>
<tr>
 <td>File Attachment: </td><td><input type="file" name="fileatt3" size="35"/></td>
</tr>
<tr>
 <td>File Attachment: </td><td><input type="file" name="fileatt4" size="35"/></td>
</tr>
</table>
<p><input type="submit" value="Send" /></p>
</form>


example of the "inline attachment"

Code: Select all

text message...
____________________________________
Deze email komt van de leidingssite.--==Multipart_Boundary_x87f7ab7022d06da6d4a98fe69b8352fdx
Content-Type: application/msword;
 name="Planningsweekend voorbereiding.doc"
Content-Transfer-Encoding: base64

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAXgAAAAAAAAAA
EAAAYQAAAAEAAAD+////AAAAAF8AAAD/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////s
pcEASQATBAAAABK/AAAAAAAAEAAAAAAABAAAsR0AAA4AYmpiarKzsrMAAAAAAAAAAAAAAAAAAAAA
AAATBBYAHkIAANDZAQDQ2QEAsRgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD//w8AAAAA
AAAAAAD//w8AAAAAAAAAAAD//w8AAAAAAAAAAAAAAAAAAAAAAF0AAAAAAAIBAAAAAAAAAgEAAAIB
AAAAAAAAAgEAAAAAAAACAQAAAAAAAAIBAAAAAAAAAgEAABQAAAAAAAAAAAAAABYBAAAAAAAAFgEA
AAAAAAAWAQAAAAAAABYBAAAAAAAAFgEAABQAAAAqAQAAPAAAABYBAAAAAAAAURIAAPIAAACSAQAA
AAAAAJIBAAAAAAAAkgEAAAAAAACSAQAAAAAAAJIBAAAAAAAAkgEAAAAAAACSAQAAAAAAAJIBAAAA
AAAA/hEAAAIAAAA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cmhvdWQgbG9rYWxlbg1TdGVsbGVuIHdl
IGVlbiBrdWlzZGllbnN0IG9wPyBFbGtlIG1hYW5kIGVlbiBhbmRlcmUgdGFrIGRpZSBldmVuIGRl
IGFsZ2VtZW5lIG9yZGUgbmFraWprdCAodm9vcmFsIGdyb290IGxva2FhbCBlbiBsZWlkaW5nc2xv (....etc etc)
Last edited by imbolc on Sat Jun 25, 2005 10:14 pm, edited 2 times in total.

mtoynbee
New php-forum User
New php-forum User
Posts: 7
Joined: Mon Apr 18, 2005 6:16 am

Solution

Postby mtoynbee » Fri Jun 24, 2005 12:39 am

Thanks for the script - very useful.

The reason why the script isnt working for the first attachment is that you have missed a '\n'. This means the headers for the first attachment are connected to the signature:

Code: Select all

$message .= "Deze email komt van de leidingssite.\n";


Works perfectly now. :D

imbolc
New php-forum User
New php-forum User
Posts: 2
Joined: Mon Aug 16, 2004 7:58 am
Contact:

Postby imbolc » Sat Jun 25, 2005 1:08 pm

wow, thank you so much... i'd lost hope of solving that one... :D

And of course, It was so simple... i just thought that at the last line of text, there shouldn't be a "new--line" command :?

Anyway, thanks !


Return to “PHP coding => Mail”

Who is online

Users browsing this forum: No registered users and 1 guest

cron