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!
go-fastAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Beverley PortlockCommented:
PEAR provides an easy to use Mail/Mime class. You need

http://www.pear.php.net/package/Mail_Mime
http://www.pear.php.net/package/Mail

Example below

<?php
include('Mail.php');
include('Mail/mime.php');
 
$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->setTXTBody($text);
$mime->setHTMLBody($html);
$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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Loganathan NatarajanLAMP DeveloperCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.