RE: [PHP] email info

From: Date: Mon, 26 Nov 2001 15:20:35 +0000
Subject: RE: [PHP] email info
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75723@lists.php.net to get a copy of this message
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 <?php //function send_mail(){ global $mail_to, $mail_name, $mail_email, $mail_title, $mail_description, $attachment; //$mail_to = "caspar@thetuckshop.com"; $mail_to = "caspar@spin.co.uk"; $mail_subject = "Photo Sent To Tourist"; $attachment_size = filesize($attachment); // Response seen by User echo "<img src=\"../tourist/thankyou.gif\">"; $mail_boundary = md5(uniqid(time())); $mail_headers .= "From: tourist@spin.co.uk \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:rtwick@niceorgaw.com] 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" <caspar@spin.co.uk> To: "Php-General" <php-general@lists.php.net> 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: <20011126122531.6679A360A@w02.web.vi.net>Date: Mon, 26 Nov 2001 > 12:25:31 +0000 (GMT)--cd3b0ec60c75e8454ec2d36d9db1b16eContent-type: > text/plain; charset=us-ascii Content-transfer-encoding: 7bit Name caspar > Emailcaspar@thetuckshop.com 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: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#75723) next »