Re: sending attachments via mail(), possible?

From: Date: Wed, 09 May 2001 19:48:03 +0000
Subject: Re: sending attachments via mail(), possible?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-52168@lists.php.net to get a copy of this message
At 15:17 9/5/2001 -0400, Tym Rehm wrote:
You have to open the file and encode it. Check out this: <?php $date = exec("date"); $border="--==================_856811060==_"; /* Define the attachment and encode it base64 */ $filename="/var/www/sf/Ftp_User_Info.doc"; $fd = fopen($filename, "r"); $contents = fread($fd, filesize($filename)); $encoded=chunk_split(base64_encode($contents)); fclose($fd); /* Trim white spaces */ $request_by = trim($request_by); $email = trim($email); $company = trim($company); /* testing if form is filled out */
the problem is that is NO file... I want to put in the attachment part just a text... but I want it to go as a text attachment... I still have to base64_encode-it even if it is text file?

« previous php.general (#52168) next »