Forum Moderators: coopster

Message Too Old, No Replies

require once "Mail.php"

         

thosecars82

8:15 pm on Jan 4, 2010 (gmt 0)

10+ Year Member



Hello
I would like to know what I have to do to be able to use this require_once "Mail.php"; with my current free web hosting account.

Whenever I run that this sentence I get this error:

Fatal error: require_once() [function.require]: Failed opening required 'Mail.php' (include_path='.:/usr/lib/php:/usr/local/lib/php')

Could you please let me know any suggestion to solve this?
Thanks in advance.

[edited by: eelixduppy at 4:37 pm (utc) on Jan. 5, 2010]

rocknbil

9:34 pm on Jan 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



try

require_once($_SERVER['DOCUMENT_ROOT']."/Mail.php");

If it's in some directory,

require_once($_SERVER['DOCUMENT_ROOT']."/directory-name/Mail.php");

thosecars82

9:51 pm on Jan 4, 2010 (gmt 0)

10+ Year Member



Well I tried the first one but it did not work.
This is what someone told me replying to my help ticket:
<snip>
What a shame!
I guess there is not a workaround.
Thanks.

[edited by: eelixduppy at 4:39 pm (utc) on Jan. 5, 2010]
[edit reason] no email quotes [/edit]

andrewsmd

10:04 pm on Jan 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would reply back on that ticket and see if they have mail.php available for you. If they don't google mail.php and get the source, then add a file on your free web hosting account called mail.php and put that source in it. Try using the include again and it should work. Mail.php may have some settings in it you will need to change, i.e. smtp host or something like that, but it should get you started. Another route would be to use the built in mail function within php, if they have configured properly and allow users to access it. If not, you may want to look at changing hosting providers.

rocknbil

7:46 am on Jan 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So you are saying . . . you were just hoping Mail.php is on the server somewhere? Or that $_SERVER['DOCUMENT_ROOT'] doesn't give you your domain root?

If not, every domain has a virtual path. You just need to know what it is. Surely they can tell you that . . . .

include_once("/var/www/accounts/your-account/example.com/Mail.php");

Note Andrew's comments, and be sure it's Mail.php you want, not mail.php.

thosecars82

2:53 pm on Jan 5, 2010 (gmt 0)

10+ Year Member



Thank you both of you.
I am going to paste the conversation I had with the guys in case you can help me out.
-------------------------------------------------------------
-------------------------------------------------------------

Snipped: No email quotes. Please read the TOS.

-------------------------------------------------------------
-------------------------------------------------------------
So, what do you say? I just would like to most straight forward approach. I think PEAR is a package that I cannot install in case it is not installed yet on the server since I do not have access to the server because it is not local hosted in my computer. I do not think it is enough by moving this Mail.php file to my website's folder since this Mail.php takes other includes recursively so I guess eventually you might need to take up the whole PEAR package which is about 26MB size in XAMPP installation and would take quite a while to be uploaded to the remote server. Moreover, I do not even know if that would work.

Another solution to avoid having to change the server with the problems it would take (I have wordpress installed and moving it to another server seems like more troubles) might be trying to avoid using PEAR even though the code of my site which was using this PEAR's mail package had already been tested by me on another server and was working great. May be there is some straight forward way to send emails with gmail accounts without using PEAR. Do you know anyone?
Thanks

[edited by: eelixduppy at 4:36 pm (utc) on Jan. 5, 2010]

encyclo

3:00 pm on Jan 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just would like to most straight forward approach.

Most straightforward approach? Move to a proper hosting package. $5 a month will do it. How much is your time worth? "Free" has a cost in terms of restrictions and poor performance.

andrewsmd

3:24 pm on Jan 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Aggreed with encyclo. I also think you may be getting two things confused. If you are looking for mail.php, that is a file named mail.php with some code in it to send an email. The support people were saying that the mail function is installed. To use the mail function, you do not need to require any external files. Just google the mail function and try that out. Post back here if you have any questions.

rocknbil

9:00 pm on Jan 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, an option to a "straightforward approach" would be to just grow your own mailer, it's relatively easy to do and as mentioned, lots of examples on the web. You shouldn't need an entire framework for a simple mailer IMO.

thosecars82

9:29 pm on Jan 5, 2010 (gmt 0)

10+ Year Member



I like this option of using my own mailer. I have not researched about it yet but I think it will be the choice I will take.
Thanks all of you.