WierdGoku Posted February 17, 2008 Share Posted February 17, 2008 Hi, I've written s acript that takes a name, email address, subject and body from a HTML form and uses the mail() function to send it to a pre-defined email address. Problem is is that it does not send it to the recipient and returns false. Any suggestions are greatly appreciated The script is http://www.jqt-chinesemedicine.com/contact.php The form is http://www.jqt-chinesemedicine.com/contact.html and the phpinfo file is http://www.jqt-chinesemedicine.com/info.php Thanks for your help WierdGoku Quote Link to comment Share on other sites More sharing options...
rofl90 Posted February 17, 2008 Share Posted February 17, 2008 Is the 'to' defintely defined? also if your using a mysql db print mysql error, if not make sure the name in the 'to' is bewing redirected to an email. Quote Link to comment Share on other sites More sharing options...
WierdGoku Posted February 17, 2008 Author Share Posted February 17, 2008 Yeah the 'to' field is already defined as a variable (ie $toAddress = "someone@domain.com"). I'm not using a mysql database as it is only going to one address. I've checked the address and it seems to be correct but it's still not going anywhere. the call to mail i'm using is: if (mail ('$toName<$toAddress>', $subject, $message, 'From: $fromName<$fromAddress>'. "\r\n")) php doesn't seem to be spilling out any errors but i'm unable to get into the server to change the config settings for that. there also doesn't seem to be any errors in the error log either ??? Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 17, 2008 Share Posted February 17, 2008 Can we see the code? Quote Link to comment Share on other sites More sharing options...
WierdGoku Posted February 17, 2008 Author Share Posted February 17, 2008 i'll post a link to a txt file cos it won't let me post the script on here!! http://www.jqt-chinesemedicine.com/contact.txt Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 17, 2008 Share Posted February 17, 2008 try this. All I did is replace single quotes with double quotes. php won't parse variables inside single quotes. if (mail ("$toName<$toAddress>", $subject, $message, "From: $fromName<$fromAddress>". "\r\n")) Quote Link to comment Share on other sites More sharing options...
WierdGoku Posted February 17, 2008 Author Share Posted February 17, 2008 oh thank you very, very much! that's been confusing me for hours! *gives chrisdburns a big hug* Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.