Jump to content

[SOLVED] Mailing Script


Lee-Bartlett

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.