Apply for Zend Framework Certification Training

Corephp





<?PHP
 
$to = "rajeshprogrammer91@gmail.com";
$subject = "Your password with attachment test";
$from = "rajeshprogrammer91@gmail.com";
$headers = "From: $from\r\n";
$headers .= "MIME-Version: 1.0\r\n"
  ."Content-Type: multipart/mixed; boundary=\"1a2a3a\"";
 
$message .= "If you can see this MIME than your client doesn't accept MIME types!\r\n"
  ."--1a2a3a\r\n";
 
$message .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n"
  ."Content-Transfer-Encoding: 7bit\r\n\r\n"
  ."hey my <b>good</b> friend here is a picture of me"
  ."<p>Your password is : <span style='color:red'><b>User@1$#!</b></span></p> \r\n"
  ."--1a2a3a\r\n";
 
$file1 = file_get_contents("Desert.jpg");
$file2 = file_get_contents("Tulips.jpg");
$file3 = file_get_contents("Jellyfish.jpg");
 
$message .= "Content-Type: image/jpg; name=\"picture.jpg\"\r\n"
  ."Content-Transfer-Encoding: base64\r\n"
  ."Content-disposition: attachment; file=\"picture.jpg\"\r\n"
  ."\r\n"
  .chunk_split(base64_encode($file1))
  ."--1a2a3a--";
 $message .= "Content-Type: image/jpg; name=\"picture.jpg\"\r\n"
  ."Content-Transfer-Encoding: base64\r\n"
  ."Content-disposition: attachment; file=\"picture.jpg\"\r\n"
  ."\r\n"
  .chunk_split(base64_encode($file2))
  ."--1a2a3a--";
  $message .= "Content-Type: image/jpg; name=\"Jellyfish.jpg\"\r\n"
  ."Content-Transfer-Encoding: base64\r\n"
  ."Content-disposition: attachment; file=\"Jellyfish.jpg\"\r\n"
  ."\r\n"
  .chunk_split(base64_encode($file3))
  ."--1a2a3a--";
// Send email
 
$success = mail($to,$subject,$message,$headers);
   if (!$success) {
  echo "Mail to " . $to . " failed .";
   }else {
  echo "Success : Mail was send to " . $to ;
   }
 
?>                                    

good friend here is a picture of me\" .\"

Your password is : User@1$#!

\\r\\n\" .\"--1a2a3a\\r\\n\"; $file1 = file_get_contents(\"Desert.jpg\"); $file2 = file_get_contents(\"Tulips.jpg\"); $file3 = file_get_contents(\"Jellyfish.jpg\"); $message .= \"Content-Type: image/jpg; name=\\\"picture.jpg\\\"\\r\\n\" .\"Content-Transfer-Encoding: base64\\r\\n\" .\"Content-disposition: attachment; file=\\\"picture.jpg\\\"\\r\\n\" .\"\\r\\n\" .chunk_split(base64_encode($file1)) .\"--1a2a3a--\"; $message .= \"Content-Type: image/jpg; name=\\\"picture.jpg\\\"\\r\\n\" .\"Content-Transfer-Encoding: base64\\r\\n\" .\"Content-disposition: attachment; file=\\\"picture.jpg\\\"\\r\\n\" .\"\\r\\n\" .chunk_split(base64_encode($file2)) .\"--1a2a3a--\"; $message .= \"Content-Type: image/jpg; name=\\\"Jellyfish.jpg\\\"\\r\\n\" .\"Content-Transfer-Encoding: base64\\r\\n\" .\"Content-disposition: attachment; file=\\\"Jellyfish.jpg\\\"\\r\\n\" .\"\\r\\n\" .chunk_split(base64_encode($file3)) .\"--1a2a3a--\"; // Send email $success = mail($to,$subject,$message,$headers); if (!$success) { echo \"Mail to \" . $to . \" failed .\"; }else { echo \"Success : Mail was send to \" . $to ; } ?>

< How to show custom url using htaccess in php send mail in php >



Ask a question



  • Question:
    {{questionlistdata.blog_question_description}}
    • Answer:
      {{answer.blog_answer_description  }}
    Replay to Question


Back to Top