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;
$subject = "test message";
$text = " This is just a test message from the MIS group";
$from = "[EMAIL PROTECTED]";
$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
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

 This is just a test message from the MIS group
Content-Type: application/zip; name="test.zip"
Content-Tranfer-Encoding: base64
Content-Disposition: attachment; filename="test.zip"



Any idea, im this new in this type of program.



PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to