InMotion Hosting Support Center

trying to email in php. getting an error with NET_SMTP.

Category: Phpbb

n/a Points
2014-03-24 3:14 pm EST

Hits: 2,941
looks as if 'Net_SMTP' is not in correct directory or php ini does not includes the correct directory.
I'm getting the following error :
Warning: include_once(Net/SMTP.php): failed to open stream: No such file or directory in /usr/local/lib/php/Mail/smtp.php on line 348

Warning: include_once(): Failed opening 'Net/SMTP.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /usr/local/lib/php/Mail/smtp.php on line 348

Fatal error: Class 'Net_SMTP' not found in /usr/local/lib/php/Mail/smtp.php on line 349

You must login before you can ask a follow up question.

You must login before you can submit an answer.



9,968 Points
2014-03-24 3:45 pm EST
Hello, and thanks for the question.

I did some digging around and I stumbled across this obsolete construction of NET_SMTP PEAR PHP bug . It looks like since PHP 5.4 the Net_SMTP line can't have the & symbol in it.

I'd recommend either using phpMailer to send mail from PHP, or you could run multiple versions of PHP on your account and from the directory that you're trying to run your mail script use this line in your.htaccess file:

AddHandler application/x-httpd-php5 .php

It looks like that PEAR bug is still open and hasn't been resolved yet, so these would probably be your best alternatives for getting email working from PHP.

Please let us know if you're still having any issues at all.

- Jacob

You must login before you can post a comment about this answer.

Like this Question?

Support Center Login

Our Login page has moved, Click the button below to be taken to the login page.

Social Media Login

Social Login Joomla

Need more Help?


Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail:
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!