Created
April 4, 2017 12:41
-
-
Save Cdetviler/6158f1de6b7f829475fa31dbc8da71f6 to your computer and use it in GitHub Desktop.
A quick php script to send an html email
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 | |
| $filepath = 'directory/test.html'; | |
| $html = file_get_contents ($filepath, FILE_USE_INCLUDE_PATH); | |
| $subject = 'test-mail'; | |
| $recipient = ''; | |
| // To send HTML mail, the Content-type header must be set | |
| $headers[] = 'MIME-Version: 1.0'; | |
| $headers[] = 'Content-type: text/html; charset=iso-8859-1'; | |
| mail($recipient, $subject, $html, implode("\r\n", $headers)); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment