[LUNI] PHP page help please!
Gordon A. Knoppe
gordon at knoppe.net
Fri Apr 6 18:06:04 CDT 2007
All the MIME work has already been done for you if you use a class like phpmailer:
http://phpmailer.sourceforge.net/
----- Original Message -----
From: James Velguth <Penguin at waxmoustache.com>
To: Linux Users Of Northern Illinois - Technical Discussion <luni at luni.org>
Sent: Friday, April 6, 2007 12:14:57 PM GMT-0600 Auto-Detected
Subject: Re: [LUNI] PHP page help please!
The files are in the same path as the php page. When I look at the
message in view source everything is where I expect it to be. Thats the
message and the encrypted files. Just nothing in the normal viewing
message window.
Chris McKeever wrote:
> are the files in the same directory as the script? if you make a
> script that just displays the file contents using the same logic you
> have (ie no path to the file defined) does it show. You may just be
> grabbing air and sending it to yourself
>
> On 4/6/07, James Velguth <Penguin at waxmoustache.com> wrote:
>
>> Hi Folks,
>> I know I am a little off topic here but I have a php page that is
>> not quite doing what I want. I want to email to myself a file from this
>> php page. It runs clean and does send the email with the attachment and
>> I can see that it does so by looking at the message source. My Firefox
>> does reconize that there is an attachment by putting the paper clip
>> opposite the message subject. The problem is that the message is
>> completely blank and there is no window to decode the mime attachment.
>> Here is the php page and any help will be appreciated. If you want to
>> run it you will have to choose your own target email address and your
>> own files.
>>
>> Thanks in advance for anybodies help.
>> James Velguth
>>
>> <?php
>>
>> $message="This is the message.";
>> $file1="XMZAdmin.csv";
>> $file2="XMZGuest.csv";
>>
>>
>> $boundary1 = "----------" . md5(uniqid(time()));
>>
>> $mime = "From: Webmaster at DuPageRiversFlyTyers.org\r\nReply-to:
>> Webmaster at DuPageRiversFlyTyers.org\r\n";
>> $mime .= "MIME-Version: 1.0\r\n";
>> $mime .= "Content-Type: multipart/mixed;\r\n";
>> $mime .= " boundary=\"$boundary1\"\r\n";
>>
>> $mime .= "This is a multi-part message in MIME format.\r\n";
>> $mime .= "$boundary1 \r\n";
>> $mime .= "Content-Type: text/plain; charset=ISO-8859-1;
>> format=flowed\r\n";
>> $mime .= "Content-Transfer-Encoding: 7bit\r\n";
>>
>> $mime .= "\r\n" . $message . "\r\n\r\n";
>>
>> $mime .= "$boundary1 \r\n";
>> $mime .= "Content-Type: application/msword;\r\n";
>> $mime .= " name=\"$file1\"\r\n";
>> $mime .= "Content-Transfer-Encoding: base64\r\n";
>> $mime .= "Content-Disposition: inline;\r\n";
>> $mime .= " filename=\"$file1\"\r\n\r\n";
>> $attach = chunk_split(base64_encode(implode("", file($file1))));
>> $mime .= "$attach";
>>
>> $mime .= "$boundary1 \r\n";
>> $mime .= "Content-Type: application/msword;\r\n";
>> $mime .= " name=\"$file2\"\r\n";
>> $mime .= "Content-Transfer-Encoding: base64\r\n";
>> $mime .= "Content-Disposition: inline;\r\n";
>> $mime .= " filename=\"$file2\"\r\n\r\n";
>> $attach = chunk_split(base64_encode(implode("", file($file2))));
>> $mime .= "$attach";
>>
>>
>> mail("Webmaster at DuPageRiversFlyTyers.org", "DupageRiversFlyTyers
>> Nightly Maintenance.", "", $mime);
>>
>> ?>
>>
>> --
>> Linux Users Of Northern Illinois - Technical Discussion
>> http://luni.org/mailman/listinfo/luni
>>
--
Linux Users Of Northern Illinois - Technical Discussion
http://luni.org/mailman/listinfo/luni
More information about the luni
mailing list