bossman Posted November 9, 2009 Share Posted November 9, 2009 I recently found a tutorial online on SMTP authentification for sending emails from webpages, here is the tutorial here... http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm here is the webpage I'm utilizing it on... http://www.adobedayevents.com/project_request/project_request.php i'm not getting an error about the SMTP server anymore, but rather an even weirder one... Fatal error: Class 'Mail' not found in D:\WebRoot\Domains\adobedayevents.com\wwwroot\project_request\send_request_2.php on line 51 line 51 is this... $smtp = Mail::factory('smtp', which is a part of this code block... $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); Can anybody tell me why on earth 'Mail' isn't a class? I know someone else who used this script for there website and it is working fine with that Mail::factory chunk in it. Anyone have a clue why it won't work on mine? Server setting? configuration?? Quote Link to comment https://forums.phpfreaks.com/topic/180895-solved-smtp-server/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 9, 2009 Share Posted November 9, 2009 The tutorial you found is using a specific mailer class - Make sure the PEAR Mail package is installed. and in the code - require_once "Mail.php"; Quote Link to comment https://forums.phpfreaks.com/topic/180895-solved-smtp-server/#findComment-954291 Share on other sites More sharing options...
bossman Posted November 9, 2009 Author Share Posted November 9, 2009 is there a way to find out if PEAR is installed with the phpinfo.php file? i can't find anything in there that tells me... Quote Link to comment https://forums.phpfreaks.com/topic/180895-solved-smtp-server/#findComment-954304 Share on other sites More sharing options...
PFMaBiSmAd Posted November 9, 2009 Share Posted November 9, 2009 PEAR is essentially a php framework made up of a base installer/core and separately installed php scripts. The phpinfo() output only contains an include path entry that does not necessarily indicate that any portion of the PEAR scripts are present. You can in fact install your own copy of PEAR, including the Mail package. The instructions are on the pear.php.net web site. There are other mailer classes, such as phpmailer and SwiftMailer that don't require the installation of as much code. Quote Link to comment https://forums.phpfreaks.com/topic/180895-solved-smtp-server/#findComment-954314 Share on other sites More sharing options...
bossman Posted November 10, 2009 Author Share Posted November 10, 2009 i figured it out, i found a workaround. THank you for your responses tho, they were very helpful. Quote Link to comment https://forums.phpfreaks.com/topic/180895-solved-smtp-server/#findComment-954811 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.