PDA

View Full Version : PHP form mailing question


godonholiday
02-07-2005, 12:43 PM
Here is the code I am using just to test the mail() function:

<?
mail('hoohaa98@yahoo.com','This is the subject','This is the body.');
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

Can anyone help because this is not working. I have heard that when using PHP (as opposed to Coldfusion or ASP) it depends on your server as to whether you can send messages or not. Is this the case and if so how can I find out if my server will allow me to do this?

Thanks in advance.

CyanBlue
02-07-2005, 02:46 PM
Howdy... :)

I do not understand the question... You have to know if your server supports PHP or not by going over the technical specification that your host has when you sign up...

godonholiday
02-07-2005, 02:52 PM
I know for sure that my server supports the version fo php that i am runnign but i read somewhere that not all servers support phps mail functions.

CyanBlue
02-07-2005, 03:06 PM
That is true... If you are creating a PHP form for one of your client, the first thing you will need to ask is if the client's host supports PHP or not... ;)

godonholiday
02-07-2005, 03:26 PM
Ok thats great advice but doesnt really help.

lets say for now that they DO have a server that supports it.

i need to know how to do it.

can you help with that??
thanks in advance

CyanBlue
02-07-2005, 03:40 PM
I fail to see what your question is... :(

Let's just say you have mail.php file with this content...
<?
mail('hoohaa98@yahoo.com','This is the subject','This is the body.');
?>
Do you get to receive an email if you execute that mail.php from the web browser's address bar???

godonholiday
02-07-2005, 03:58 PM
no it does not work despite the server accepting php scripts

CyanBlue
02-07-2005, 07:11 PM
Uh... I really don't know what's going on then... That mail() function should be pretty much universal...
Check with the host to see if they require any additional information to execute the mail() function... Some host does requires host specific information...

godonholiday
02-07-2005, 07:23 PM
ok i'll get in touch with them

CyanBlue
02-07-2005, 07:33 PM
Yeah... Don't forget to let us know what you have found out... :)

godonholiday
02-14-2005, 01:13 PM
i got it working but i had to change hosts.

despite blueyonder assuring me that mail() was enabled and should work, as soon as i put it onto a different server it finally worked

so cheers for the help anyway