I'm using Mac OSX, and when I try to create a temporary file, I get this message:
$temp_file = tmpfile();
Could not create temporary files for attachments. Your tmp directory may be unwritable by PHP
I checked the directory, and here's what I see:
echo sys_get_temp_dir();
ls -ld /var/folders/v1/9BmtDyVv7v15d6qx07_4ylfh0000gn/T
drwx------ 41 mark staff 1394 Feb 21 12:44 /var/folders/v1/9BmtDyVv7v15d6qx07_4ylfh0000gn/T