Lee-Bartlett Posted November 20, 2008 Share Posted November 20, 2008 Ok, im not sure how to do this, imagine i have just a form button and when that is clicked i need it to send an email to my email adress, i used the basic code, seen below. But that dont work, how do i acheive this ? <?php $to = "[email protected]"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; if (mail($to, $subject, $body)) { echo("<p>Message</p>"); } else { echo("<p>Message delivery failed...</p>"); } ?> Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/ Share on other sites More sharing options...
rhodesa Posted November 20, 2008 Share Posted November 20, 2008 code looks fine. are you running this on a server you setup or a hosting service? and what OS is the server running? Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/#findComment-694380 Share on other sites More sharing options...
Lee-Bartlett Posted November 20, 2008 Author Share Posted November 20, 2008 This is on my own domain, got from The Planet Internet Services, Inc and my OS is mac, if thats what you mean. Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/#findComment-694381 Share on other sites More sharing options...
mtoynbee Posted November 20, 2008 Share Posted November 20, 2008 If you are running your own web server then you need to configure mail within the php.ini file. This is configured automatically on a hosted server. http://uk.php.net/mail should have all the info you need Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/#findComment-694388 Share on other sites More sharing options...
rhodesa Posted November 20, 2008 Share Posted November 20, 2008 well...wherever the webserver is running, and this script is being run, you should check your PHP settings. Here are the ones related to mail: http://us2.php.net/manual/en/mail.configuration.php Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/#findComment-694390 Share on other sites More sharing options...
rhodesa Posted November 20, 2008 Share Posted November 20, 2008 If you are running your own web server then you need to configure mail within the php.ini file. This is configured automatically on a hosted server. http://uk.php.net/mail should have all the info you need if it is on a hosting service...it *should* be configured properly, but that might now always be true. you can always give their tech support a call and tell them to look at it Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/#findComment-694393 Share on other sites More sharing options...
Lee-Bartlett Posted November 20, 2008 Author Share Posted November 20, 2008 Ye ill look at the settings etc... ty anyway, ill tick as solved so more look Link to comment https://forums.phpfreaks.com/topic/133504-solved-mailing-script/#findComment-694399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.