Skip to content

Lukas Arts – Web Designer & Developer

Web designer & photographer
Aug 31 10

frenchknickers.com re-design

by Lukas

Interface re-design for french knickers.com. Adobe Design Premium CS4

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
-->

Aug 31 10

New interface design

by Lukas

New Interface created in CS4

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
-->

Jul 18 10

Royal International Air Tattoo 2010 – RIAT 2010

by Lukas

Just got back from Air Tattoo, Fairford 2010. Utter heavy traffic not only on A417 but also in the air ;) What an amazing display! Just a few shots from saturday and I’m off to bed!





RIAT 2010

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
-->

Just got back from Air Tattoo, Fairford 2010. Utter heavy traffic not only on A417 but also in the air ;) What an amazing display! Just a few shots from saturday and I’m off to bed!

Mar 30 10

Isle of Skye

by Lukas

Isle of Skye is one of the most beautiful place I’ve ever been. I’ve spent there a couple of days this January and let’s face it – this island is gorgeous. Just a few pics from my 3 days trip.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
-->

Isle of Skye is one of the most beautiful place I’ve ever been. I’ve spent there a couple of days this January and let’s face it – this island is gorgeous. Just a few pics from my 3 days trip.

Mar 18 10

php mail() multiple attachments solution

by Lukas

If you need a solution for multiple attachments in PHP using mail() function take a look below. Code below allows to attach and send 2 files. If you still having problems just take a look at raw email file. Each attachment needs to be divided by mime boundary (same boundary for each file) and this boundary needs to be added at the end of our message.


$logo = $_FILES['logo']['tmp_name'];
$logo_type = $_FILES['logo']['type'];
$logo_name = $_FILES['logo']['name'];
$image      = $_FILES['image']['tmp_name'];
$image_type = $_FILES['image']['type'];
$image_name = $_FILES['image']['name'];

headers = "From: no-reply@mydomainhere.co.uk";
if (is_uploaded_file($logo)) {
$file = fopen($logo,'rb');
$data = fread($file,filesize($logo));
fclose($file);

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

Add the headers for a file attachment
$headers .= "nMIME-Version: 1.0n" .
"Content-Type: multipart/mixed;n" .
" boundary="{$mime_boundary}"";

Add a multipart boundary above the plain message
$message = "--{$mime_boundary}n" .
"Content-Type: text/plain; charset="iso-8859-1"n" .
"Content-Transfer-Encoding: 7bitnn" .
"Name : $_POST[name] nn" .
"Address : $_POST[address] nn" .
"Description: $_POST[description] nn";

Base64 encode the file data
$data = chunk_split(base64_encode($data));

Add file attachment to the message
$message .= "--{$mime_boundary}n" .
"Content-Type: {$logo_type}; name="{$logo_name}"n" .
"Content-Disposition: attachment; filename="{$logo_name}"n" .
"Content-Transfer-Encoding: base64n" .
"X-Attachment-Id: file_{$rand_id}nn" .
$data . "nn";
}

 Second attachment
if (is_uploaded_file($image)) {
 Read the file to be attached ('rb' = read binary)
$file = fopen($image,'rb');
$data = fread($file,filesize($image));
fclose($file);

 Base64 encode the file data
$data = chunk_split(base64_encode($data));

 Add file attachment to the message
$message .= "--{$mime_boundary}n" .
"Content-Type: {$image_type}; name="{$image_name}"n" .
"Content-Disposition: attachment; filename="{$image_name}"n" .
"Content-Transfer-Encoding: base64n" .
"X-Attachment-Id: file_{$rand_id}nn" .
$data . "nn" .
"--{$mime_boundary}--n";
}

Send the message
$ok = @mail("confirmations@mydomainhere.co.uk", $subject, $message, $headers);
if ($ok) {
echo "OK!";
} else {
echo "Error!!";
}
}

 

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)
-->

If you need a solution for multiple attachments in PHP using mail() function take a look below. Code below allows to attach and send 2 files. If you still having problems just take a look at raw email file. Each attachment needs to be divided by mime boundary (same boundary for each file) and this boundary needs to be added at the end of our message.