The thing is that you can send and receive attachments perfectly if you send
directly from an email client such as outlook or webbased mail such as
hotmail.
I have attached my script below
";
$mail_boundary = md5(uniqid(time()));
$mail_headers .= "From: [EMAIL PROTECTED] \n";
$mail_headers .= "MIME-Version: 1.0\r\n";
$mail_headers .= "Content-type: multipart/mixed;";
$mail_headers .= "boundary= \"$mail_boundary\"";
$mail_headers .= "\r\n\r\n";
$new_mail_body .= "--$mail_boundary\n";
$new_mail_body .= "Content-type: text/plain; charset=us-ascii\r\n";
$new_mail_body .= "Content-transfer-encoding: 7bit\r\n\r\n";
$new_mail_body .= "Name ".$mail_name;
$new_mail_body .= "\r\n";
$new_mail_body .= "Email ".$mail_email;
$new_mail_body .= "\r\n";
$new_mail_body .= "Title ".$mail_title;
$new_mail_body .= "\r\n";
$new_mail_body .= "Description ".$mail_description;
$new_mail_body .= "\r\n";
if (!$attachment_size){
NULL;
}else{
$new_mail_body .= "--$mail_boundary\n";
$fp = fopen($attachment, "r");
$file = fread ($fp, filesize ($attachment));
$file = chunk_split(base64_encode($file));
$mime_type ="image/gif";
$new_mail_body .= "Content-type:$mime_type; name=\"$mail_title\"\r\n";
$new_mail_body .= "Content-transfer-encoding:base64\r\n\r\n";
$new_mail_body .= $file;
$new_mail_body .= "\r\n\r\n";
}
$new_mail_body .= "--$mail_boundary--";
return mail($mail_to , $mail_subject, $new_mail_body, $mail_headers);
?>
-Original Message-
From: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 14:42
To: Caspar Kennerdale; Php-General
Subject: Re: [PHP] email info
looks like your email client at work is not capable of handling the image
(.gif) attachments. check in the help secion of your email client.
HTH
- Original Message -
From: "Caspar Kennerdale" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Monday, November 26, 2001 8:16 AM
Subject: [PHP] email info
> can anyone recommend a site or discussion list relating to email
>
> I have a form to mail script which sends attachments - it all works if I
> have my private email address as the recipient,
>
> however if I use my work email address the mail comes out with no
attachment
> but displays gobbledigook like-
>
> "Content-type: multipart/mixed;boundary=
"cd3b0ec60c75e8454ec2d36d9db1b16e"
> Message-Id: <[EMAIL PROTECTED]>Date: Mon, 26 Nov
2001
> 12:25:31 + (GMT)--cd3b0ec60c75e8454ec2d36d9db1b16eContent-type:
> text/plain; charset=us-ascii Content-transfer-encoding: 7bit Name caspar
> [EMAIL PROTECTED] Title text submit Description test
> submit --cd3b0ec60c75e8454ec2d36d9db1b16eContent-type:image/gif;
name="text
> submit"
> Content-transfer-encod
>
> If i forward my work email to my private email then the emaiul is fine-
>
> is this a script error, a mail server/ isp error, local mail server error
>
> any ideas thanks in advance
>
>
>
>
> --
> 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]
>
>
--
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]