473,327 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Disabled mail function workaround?

Hi! I have been asked to add some functionality to an existing web
site. The user would like to have a form that would email them the
results of the form. Really easy stuff to do, usually. I tried to
run the enhancements, and did not get the results I wanted, either
with writing the results to a log file on the server, nor in sending
the email.

In doing further research, I see that the site is being hosted on a
windows server, and that the php appears to have a bunch of functions
disabled, when I run phpinfo. One of the many that are disabled is
mail, so I'm kind of stuck. Is there any sort of workaround to this,
where the mail function is disabled, but I'd still be able to send
email from a form?

For reference, here are the functions that are disabled:

getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect,
crack_check, crack_closedict, crack_getlastmessage, crack_opendict,
fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all,
ini_alter, ini_set, get_current_user, get_defined_constants,
get_include_path, php_ini_scanned_files, php_uname, phpcredits,
restore_include_path, set_include_path, set_time_limit, version_compare,
zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen,
fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir

Thanks!
Scott
Aug 8 '06 #1
3 1979
sa*@worf.netins.net (Scott Evans) wrote:
In doing further research, I see that the site is being hosted on a
windows server, and that the php appears to have a bunch of functions
disabled, when I run phpinfo. One of the many that are disabled is
mail, so I'm kind of stuck. Is there any sort of workaround to this,
where the mail function is disabled, but I'd still be able to send
email from a form?

For reference, here are the functions that are disabled:

getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect,
crack_check, crack_closedict, crack_getlastmessage, crack_opendict,
fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all,
ini_alter, ini_set, get_current_user, get_defined_constants,
get_include_path, php_ini_scanned_files, php_uname, phpcredits,
restore_include_path, set_include_path, set_time_limit, version_compare,
zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen,
fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir
Can you use system() to run blat.exe (google for it)?

Also, odd (but irrelevant) that you can't fread() but you can
file_get_contents().

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu
Aug 8 '06 #2
getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect,
crack_check, crack_closedict, crack_getlastmessage, crack_opendict,
fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all,
ini_alter, ini_set, get_current_user, get_defined_constants,
get_include_path, php_ini_scanned_files, php_uname, phpcredits,
restore_include_path, set_include_path, set_time_limit, version_compare,
zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen,
fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir
I really can't see any reason why these are setup like this. ini_get is
disabled? That pretty much means that any advanced service will fail
when it checks system requirements. phpcredits? Surely that's harmless.
Assert? That's useful for debugging. My gut feeling says that
either: a) the host is trying to be secure, but is just limiting
functionality, or b) the host hasn't setup the server correctly, so they
are trying to avoid these problems. For example, fread could be
disabled to avoid reading files from other accounts. Any properly setup
host would have their permissions configured correctly.

Have you tried contacting them? fwrite and fread are critical for ANY
application and is going to indicate high loads -- caching becomes near
impossible.

Probably not what you want to hear: If they don't want to enable these,
get out. It probably indicates that they don't know what they're doing.

All the best,
Carl
Aug 8 '06 #3
On Tue, 8 Aug 2006 15:27:30 +0000 (UTC), sa*@worf.netins.net (Scott Evans)
wrote:
>Hi! I have been asked to add some functionality to an existing web
site. The user would like to have a form that would email them the
results of the form. Really easy stuff to do, usually. I tried to
run the enhancements, and did not get the results I wanted, either
with writing the results to a log file on the server, nor in sending
the email.

In doing further research, I see that the site is being hosted on a
windows server, and that the php appears to have a bunch of functions
disabled, when I run phpinfo. One of the many that are disabled is
mail, so I'm kind of stuck. Is there any sort of workaround to this,
where the mail function is disabled, but I'd still be able to send
email from a form?
Well, the proper answer is to ask the admin to re-enable mail, or switch
hosts. If they've disabled the mail functions, and you do some hacky workaround
to send mail anyway without asking the admins, it wouldn't be that surprising
if the admin of the server got somewhat annoyed...
>getmyinode, getopt, getrusage, extension_loaded, dl, mysql_pconnect,
crack_check, crack_closedict, crack_getlastmessage, crack_opendict,
fsockopen, pfsockopen, mysql_list_dbs, mysql_stat, ini_get, ini_get_all,
ini_alter, ini_set, get_current_user, get_defined_constants,
get_include_path, php_ini_scanned_files, php_uname, phpcredits,
restore_include_path, set_include_path, set_time_limit, version_compare,
zend_version, getmypid, getmyuid, getmygid, assert_options, assert, fopen,
fwrite, fread, file, fpassthru, file, mail, opendir, readdir, closedir
If they're locking down things as basic as fopen then you'll have difficulty
communicating with the outside world in any way; you're not likely to be able
to open any sockets to even do SMTP mailing yourself.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: haref | last post by:
hi ng, what can i do in the following mail function, which hast 400 subscribers who are read from a database and to which the mails are send in a loop, when there are some adresses who are not...
1
by: haref | last post by:
hi ng, what can i do in the following mail function, which hast 400 subscribers who are read from a database and to which the mails are send in a loop, when there are some adresses who are not...
7
by: Jim Seymour | last post by:
I have a contact form that uses PHP's mail() function. It recently came to my attention that (some?) MS-Windows mail servers may not properly process data given to the mail() function that's only...
2
by: Groupe Eurower | last post by:
Hi, I would like contribute to the PHP development but i don't really know where i can submit my codes ! In fact, i'm a Web Hosting and i authorize the utilisation of the mail() function. ...
4
by: Data Goob | last post by:
This one has me stumped. How did SuSE disable the mail() function in their RPM'd version of PHP? ( This is their install-version of PHP with RPMs not what you download from PHP.net ) I have...
11
by: Lieven | last post by:
Hey, I had a hard disc problem last week on my server. I replaced the disc and copied al the files to the new hard disc, everything works fine again except some php scripts that are using the...
13
Nert
by: Nert | last post by:
hello every one, i need help.. how can i use the mail() funtion in php? when ever i execute the mail function i continuesly receive this error message: what do i need to do in order for me...
9
by: shror | last post by:
hi every body, i have a problem which is when i was checking my mail() form it work fine but the problem is that the form configuration is not set correctly, in details: the from var is not...
1
by: Abersparky | last post by:
Can someone help me with the mail() function??? The below is just to get myself going but I can't seem to get it working... is there something else I should be doing? I checked phpinfo() and the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.