yes of course
[php]
<?php
$fromAddr = '
[email protected]'; // the address to show in From field.
$recipientAddr = '
[email protected]'; //the address to who it will send the email.
$subjectStr = 'Thank you';
$mailBodyText = <<<END89283
Thank You
Login: dummy text blah blah blah
Password: blah blah blah blah
END89283;
// change this to the path of the image from the database
$filePath = 'great_house.jpg';
$fileName = basename($filePath);
$fileType = 'image/jpeg';
/* to find out what string to use for type, see
http://en.wikipedia.org/wiki/Internet_media_type
or $_FILES['attachment']['type'];
*/
/* encode the email content */
$mineBoundaryStr='otecuncocehccj8234acnoc231';
$headers= <<<EEEEEEEEEEEEEE
From: $fromAddr
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="$mineBoundaryStr"
EEEEEEEEEEEEEE;
// Add a multipart boundary above the plain message
$mailBodyEncodedText = <<<TTTTTTTTTTTTTTTTT
This is a multi-part message in MIME format.
--{$mineBoundaryStr}
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
$mailBodyText
TTTTTTTTTTTTTTTTT;
$file = fopen($filePath,'rb');
$data = fread($file,filesize($filePath));
fclose($file);
$data = chunk_split(base64_encode($data));
// file attachment part
$mailBodyEncodedText .= <<<FFFFFFFFFFFFFFFFFFFFF
--$mineBoundaryStr
Content-Type: $fileType;
name=$fileName
Content-Disposition: attachment;
filename="$fileName"
Content-Transfer-Encoding: base64
$data
--$mineBoundaryStr--
FFFFFFFFFFFFFFFFFFFFF;
if (
mail( $recipientAddr , $subjectStr , $mailBodyEncodedText, $headers )
) {
echo '
SenT successfully!
';
} else {
echo '
Message not Sent
';
}
?>
[/php]
all you need to change to have a working script is line 2,3 and 24.
along any modification you make
I didn’t make the script so Don’t credit me for the script.