Any help would be great
Thanks
Code: Select all
include('Mail.php');
include('Mail/mime.php');
$sender = "Joe soap <info@me.com>";
$recipient = "Crazy<info@you.com>";
$subject = "Test Email";
$text = 'This is a test message.';
$html = '<html><body><p>This is a html message</p></body></html>'; $crlf = "\n";
$headers = array(
'From' => $sender,
'Return-Path' => $sender,
'Subject' => $subject
);
// Creating the Mime message
$mime = new Mail_mime($crlf);
// Setting the body of the email
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
// Add an attachment
$file = "Hello World!";
$file_name = "files/somefile.pdf";
$content_type = "Application/pdf";
$mime->addAttachment ($file, $content_type, $file_name, 0);
$body = $mime->get();
$headers = $mime->headers($headers);
// Sending the email
$mail =& Mail::factory('mail');
$mail->send($recipient, $headers, $body)