mail smtp class file

From: Date: Thu, 22 Nov 2001 02:39:28 +0000
Subject: mail smtp class file
Groups: php.general 
Request: Send a blank email to php-general+get-75467@lists.php.net to get a copy of this message
Hi there, I've tried using the SMTP class file that was given by PHPGalaxy.com previously in the mailing list, and have difficuties in using it. upon the execution of the script im recieving the mail but the content of the mail was the HEADER. Here's the script: <? function sendmsg($to, $subject, $text, $from, $file, $type) { $content = fread(fopen($file,"r"),filesize($file)); $content = chunk_split(base64_encode($content)); $uid = strtoupper(md5(uniqid(time()))); $name = basename($file); $header = "From: $from\nReply-To: $from\n"; $header .= "MIME- Version: 1.0\n"; $header .= "Content-Type: multipart/mixed; boundary=$uid\n"; $header .= "--$uid\n"; $header .= "Content-Type: text/plain;\n"; $header .= "Content-Transfer-Encoding: 7bit\n\n"; $header .= "$text\n"; $header .= "--$uid\n"; $header .= "Content-Type: $type; name=\"$name\"\n"; $header .= "Content-Tranfer-Encoding: base64\n"; $header .= "Content-Disposition: attachment; filename=\"$name\"\n\n"; $header .= "$content\n"; $header .= "--$uid--"; mail($to, $subject, "", $header); return true; } $to = "mikecarel@team8.teamglac.com"; $subject = "test message"; $text = " This is just a test message from the MIS group"; $from = "mikecarel@teamglac.com"; $file = "test.zip"; $type = "application/zip"; sendmsg($to, $subject, $text, $from, $file, $type); print("message sent"); ?> And the email content was this: MIME- Version: 1.0 Content-Type: multipart/mixed; bountry=4C67EBB57A700797D865BFD2E30B7E01 --4C67EBB57A700797D865BFD2E30B7E01 Content-Type: text/plain Content-Transfer-Encoding: 7bit This is just a test message from the MIS group --4C67EBB57A700797D865BFD2E30B7E01 Content-Type: application/zip; name="test.zip" Content-Tranfer-Encoding: base64 Content-Disposition: attachment; filename="test.zip" dGhpcyBpcyBqdXN0IGEgdGVzdCB6aXAgZmlsZSBrdW5vISEhIQ== --4C67EBB57A700797D865BFD2E30B7E01-- Any idea, im this new in this type of program. Regards, Mikecarel

« previous php.general (#75467) next »