Created
January 16, 2013 23:01
-
-
Save Enome/4551798 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| # WRITE TO FILE | |
| function write_to_file ($file, $str) { | |
| $open = fopen($file, 'a'); | |
| fwrite($open, "$str \n"); | |
| fclose($open); | |
| }; | |
| # CSV | |
| function write_csv ($file, $post) { | |
| $values = array(); | |
| # Add values to array | |
| foreach ($post as $key => $val) { | |
| $values[] = str_replace(array("\n", "\r"), "", $val); | |
| } | |
| $values = join($values, "|"); | |
| write_to_file($file, $values); | |
| }; | |
| function email ($to, $from, $subject, $template, $values, $redirect) { | |
| # Get content from template | |
| ob_start(); | |
| include($template); | |
| $recruiter = ob_get_clean(); | |
| # Headers for html templates | |
| $headers = 'MIME-Version: 1.0' . "\r\n"; | |
| $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; | |
| $headers .= "From: $from" . "\r\n"; | |
| # Mail it | |
| return mail($to, $subject, $recruiter, $headers); | |
| }; | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment