Skip to content

Instantly share code, notes, and snippets.

@wufoo
wufoo / sendEmail.php
Created March 22, 2011 19:39
Send Email
<?php
function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) {
$file = $path.$filename;
$file_size = filesize($file);
$handle = fopen($file, "r");
$content = fread($handle, $file_size);
fclose($handle);
$content = chunk_split(base64_encode($content));
$uid = md5(uniqid(time()));
$name = basename($file);
<?php if ($_GET['results']) { ?>
<!-- Embed results here -->
<?php } else { ?>
<!-- Embed form here -->
<?php } ?>
@wufoo
wufoo / SendEmailwFileAttachment.php
Created March 28, 2011 17:50
For use with Wufoo WebHook
<?php
// NOTE: it's best practice to CLEAN YOUR INPUTS
// http://www.acunetix.com/websitesecurity/php-security-1.htm
function mail_attachment($filename, $path, $mailto, $from_mail, $from_name, $replyto, $subject, $message) {
$file = $path.$filename;
$file_size = filesize($file);
$handle = fopen($file, "r");