Looking for PHP Mail class recommendations

I am looking for recommendations for a custom PHP mail class that I could use to process mail in my PHP apps. I am having difficulty with htmlMimeMail (http://www.phpguru.org/static/mime.mail.html).

The From field has a weird server email address that is not working as intended.

Any alternatives would be appreciated :) Thanks!
Who is Participating?
Beverley PortlockConnect With a Mentor Commented:
PEAR provides an easy to use Mail/Mime class. You need


Example below

$text = 'Text version of email';
$html = '<html><body>HTML version of email</body></html>';
$file = '/home/richard/example.php';
$crlf = "\n";
$hdrs = array(
              'From'    => 'you@yourdomain.com',
              'Subject' => 'Test mime message'
$mime = new Mail_mime($crlf);
$mime->addAttachment($file, 'text/plain');
//do not ever try to call these lines in reverse order
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail =& Mail::factory('mail');
$mail->send('postmaster@localhost', $hdrs, $body);

Open in new window

Loganathan NatarajanConnect With a Mentor LAMP DeveloperCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.