Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. $to = 'form@kronova.in, ' . $Email;
  2. $subject = 'ABC :: Admission Form Details';
  3. $repEmail = 'form@kronova.in';
  4.  
  5. $fileName = 'ABC-Admission.pdf';
  6. $fileatt = $pdf->Output($fileName, 'E');
  7. $attachment = chunk_split($fileatt);
  8. $eol = PHP_EOL;
  9. $separator = md5(time());
  10.  
  11. $headers = 'From: Principal abc <'.$repEmail.'>'.$eol;
  12. $headers .= 'MIME-Version: 1.0' .$eol;
  13. $headers .= "Content-Type: multipart/mixed; boundary="".$separator.""";
  14.  
  15. $message = "--".$separator.$eol;
  16. $message .= "Content-Transfer-Encoding: 7bit".$eol.$eol;
  17. $message .= "Thanks for filling online application form. Your online admission registration number is E0000". mysql_insert_id() . "." .$eol;
  18.  
  19. $message .= "--".$separator.$eol;
  20. $message .= "Content-Type: text/html; charset="iso-8859-1"".$eol;
  21. $message .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
  22.  
  23. $message .= "--".$separator.$eol;
  24. $message .= "Content-Type: application/pdf; name="".$fileName.""".$eol;
  25. $message .= "Content-Transfer-Encoding: base64".$eol;
  26. $message .= "Content-Disposition: attachment".$eol.$eol;
  27. $message .= $attachment.$eol;
  28. $message .= "--".$separator."--";
  29.  
  30. if (mail($to, $subject, $message, $headers)){
  31. echo "Email sent";
  32. }
  33.  
  34. else {
  35. echo "Email failed";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement