Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $mailheaders = "From: $fromn";
- $mailheaders .= "Reply-To: $fromn";
- $mailheaders .= "Cc: $ccn";
- $mailheaders .= "Bcc: $bccn";
- $mailheaders .= "X-Mailer: Script para enviar arquivo atachadon";
- $msg_body = stripslashes($body);
- if ($attach != "none")
- {
- $file = fopen($attach, "r");
- $contents = fread($file, $attach_size);
- $encoded_attach = chunk_split(base64_encode($contents));
- fclose($file);
- $mailheaders .= "MIME-version: 1.0n";
- $mailheaders .= "Content-type: multipart/mixed; ";
- $mailheaders .= "boundary="Message-Boundary"n";
- $mailheaders .= "Content-transfer-encoding: 7BITn";
- $mailheaders .= "X-attachments: $attach_name";
- $body_top = "--Message-Boundaryn";
- $body_top .= "Content-type: text/plain; charset=US-ASCIIn";
- $body_top .= "Content-transfer-encoding: 7BITn";
- $body_top .= "Content-description: Mail message bodynn";
- $msg_body = $body_top . $msg_body;
- $msg_body .= "nn--Message-Boundaryn";
- $msg_body .= "Content-type: $attach_type; name="$attach_name"n";
- $msg_body .= "Content-Transfer-Encoding: BASE64n";
- $msg_body .= "Content-disposition: attachment; filename="$attach_name"nn";
- $msg_body .= "$encoded_attachn";
- $msg_body .= "--Message-Boundary--n";
- }
- mail($to, stripslashes($subject), $msg_body, $mailheaders);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement