No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
<?php $to="sreedevs.arun@gmail.com"; $subject="bad boy"; $message="message"; $attachment="image.jpg"; $attachment_MIME_type="image/jpeg"; $handle=fopen ($attachment,"rb"); $data=fread ($handle, filesize($attachment)); fclose ($handle); $boundary="---Multipart_Boundary----"; $headers="\nMIME-Version: 1.0\n". "Content-Type: multipart/mixed;\n". " boundary=\"".$boundary."\""; $data=chunk_split(base64_encode($data)); $text="--".$boundary."\n"; "Content-Type:text/plain\nContent-Transfer-Encoding: 7bit\n\n". $message."\n\n--".$boundary."\n". "Content-Type:".$attachment_MIME_type.";\n name=\"". $attachment."\"\nContent-Transfer-Encoding:base64\n\n". $data."\n\n--".$boundary."--\n"; $result=@mail($to,$subject,$text,$headers); if($result) { echo "the mail was sent"; } else { echo "the mail was not sent"; } ?> output … |
|
Hello frnds... i want to send mail with attachment using mail function.. Any one can u pls give me the solution. Shanti |
|
can anyone provide compleate source code????..including userinterface..pls.. |
|
Hello! I'm looking to create a simple form with PHP that will allow users to attach multiple files. For example, I'd like to offer these five fields: - First Name (text) - Last Name (text) - Word Document (browse) - PDF Document (browse) - Excel Document (browse) I am new … |