RSS
Home Posts tagged "mail"
formats

HTML mail() Sending as Plain Text

Published on May 11, 2010 by in bug, html, php

$to = "email@address.com"; $subject = "SUBJECT"; $message = "<b>MESSAGE</b>"; $headers = ‘MIME-Version: 1.0′ . "\r\n"; $headers .= ‘Content-type: text/html; charset=iso-8859-1′ . "\r\n"; $headers .= ‘From: Mailer ‘ . "\r\n"; mail($to, $subject, $message, $headers); The above code does not always send emails in HTML as it should, it turns out there is a PHP Bug (http://bugs.php.net/15841)

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

A PHP Mail Class

Below is a Mail class I created in PHP, it requires 4 arguments on initiation of the class via the constructor and uses the method ->send() to send the created mail once complete. class Mail {         var $to;         var $subject;         var $content;  

Read More…

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Send Email PHP Function

Ever find yourself typing the headers into the php mail() function over and over again? Try using a standard function and calling it when you need to send mail. function sendEmail($subject,$content,$from,$to){ $header = “Content-Type: text/html; charset=iso-8859-1\nFrom:$from”; if( mail($to, $subject, $content, $header) ); }

 
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
1 Comment  comments 

This is the official blog of HSMoore Ltd.

© Site by HSMoore Ltd