Solved

phpmailer on bluehost

Posted on 2013-05-21
6
1,521 Views
Last Modified: 2013-05-21
I'm moving a basic form to email script to a new Bluehost account (Apache).  The script uses phpmailer.  The code to call the script is...

require("class.phpmailer.php");
$mail = new PHPMailer();

I'm getting the following error on the 'class.phpmailer.php' line...

Fatal error: require() [function.require]: Failed opening required 'class.phpmailer.php' (include_path='.:/xxx/xxx/php:/xxx/lib/php:/xxx/share/pear') in /xxx/xxx/xxx/xxxxx/apply/city-signup-code.php on line 101

It looks to me like it can't find class.phpmailer.php.  I called Bluehost tech and they couldn't help me unless I could tell them what phpmailer requires.  Since the script just worked on the previous webhost, I couldn't tell them.

Any ideas are greatly appreciated.

Thanks,

Steve
0
Comment
Question by:stkoontz
6 Comments
 
LVL 16

Assisted Solution

by:Chris Harte
Chris Harte earned 166 total points
ID: 39184370
The require failed because it could not find the file 'class.phpmailer.php'. It does not matter what phpmailer() does or does not 'require' because the file containing the class is unreachable. New host, I am going to guess this is a permissions or path problem. Tell tech support to stop asking dumb questions and check the permissions on the file and that the path to the flle is correct.
0
 
LVL 2

Author Comment

by:stkoontz
ID: 39184427
Thanks for the quick response.  

That's what I was thinking.  I put in a support ticket so should hear back by tomorrow.
0
 
LVL 82

Assisted Solution

by:hielo
hielo earned 167 total points
ID: 39184517
>>The script uses phpmailer
Let's say that The script is located at /var/www/html/the_script.php.  In order for require("class.phpmailer.php"); to work, then you also need to have "class.phpmailer.php" in the same directory/folder as "the_script.php".  Do you?

If not, you have to specify the correct path to "class.phpmailer.php".  For instance, if it is located in /var/www/html/includes/classes/classphpmailer.php, then try providing the absolute path:
require('/var/www/html/includes/classes/classphpmailer.php');
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 108

Expert Comment

by:Ray Paseur
ID: 39184625
This function may be helpful as you try to track down the correct directory path.
http://php.net/manual/en/function.getcwd.php

See also:
http://php.net/manual/en/function.phpinfo.php
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 167 total points
ID: 39185169
Why don't you download a fresh copy of PHPMailer and upload the file to where it needs to be?  http://code.google.com/a/apache-extras.org/p/phpmailer/wiki/PHPMailer
0
 
LVL 2

Author Closing Comment

by:stkoontz
ID: 39185624
Thanks for the help.  I downloaded a copy of PHPMailer, uploaded it to my server, and directed the path to the file and it's working now.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now