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 | |
$root = $_SERVER['DOCUMENT_ROOT']; | |
chdir($root); | |
$path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); | |
set_include_path(get_include_path().':'.__DIR__); | |
if(file_exists($root.$path)) | |
{ | |
if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') | |
$path = rtrim($path,'/').'/index.php'; |
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
-- Mail-merge script | |
-- Assembled by John Wickerson (using various parts pasted from the internet, credited individually below) in April 2021. | |
-- Instructions: | |
---- 1. Select a message in Mail (probably one that has been saved as a Draft) and then run this script. | |
---- 2. The script will ask you for a CSV file containing the data to be mail-merged. The first column of this CSV file must be named "email". | |
---- 3. The script will substitute $FOO in the contents of the message with the contents of column FOO in the CSV file. | |
---- 4. Any to/cc/bcc recipients in the original message will be preserved. | |
---- 5. Unfortunately, any attachments in the original message are not preserved, but if you want an attachment, you can add it | |
---- using this script by uncommenting one of the lines below. |
OlderNewer