The Sea King Posted August 23, 2007 Share Posted August 23, 2007 I need a custom email form that has only one field which is Email. Below is this message which is the be sent to this email adress: lostwaterking@hotmail.com The message: I wish to to subsrcibe to this site for updates ------Thanks in advance. Link to comment Share on other sites More sharing options...
MrAdam Posted August 23, 2007 Share Posted August 23, 2007 look into PHP's mail() function .. Link to comment Share on other sites More sharing options...
user4fun Posted August 23, 2007 Share Posted August 23, 2007 form_email.htm <form name="Email stuff" action="send_email.php"method="post"><input type="text" name="Email" size="20" value="Youe email address" tabindex="1"><input type="submit" value="Submit" name="Submit"></p></form> The above form is in page form_email.htmit will grab the user entry and POST it to the send_email.php filesend_email.php $email = $_REQUEST['Email'];$to = "lostwaterking@hotmail.com";$headers = "From: Mysite <lostwaterking@hotmail.com>\r\n";$headers .= 'Reply-To: Updates <lostwaterking@hotmail.com>';$title = "Request to subscribe";$body = <<< emailbodyI wish to subscribe to this site for updatesthe email that i have given you is $emailemailbody;$success = mail($to,$title,$body,$headers);?> good luck, i dont know much, but let me know if there is anything else i can do for you. Link to comment Share on other sites More sharing options...
The Sea King Posted August 23, 2007 Author Share Posted August 23, 2007 Thanks! Link to comment Share on other sites More sharing options...
user4fun Posted August 23, 2007 Share Posted August 23, 2007 No problem, glad to help. Link to comment Share on other sites More sharing options...
The Sea King Posted August 28, 2007 Author Share Posted August 28, 2007 question: Is it missing the beginning... <?php in this code: $email = $_REQUEST['Email'];$to = "lostwaterking@hotmail.com";$headers = "From: Mysite <lostwaterking@hotmail.com>\r\n";$headers .= 'Reply-To: Updates <lostwaterking@hotmail.com>';$title = "Request to subscribe";$body = <<< emailbodyI wish to subscribe to this site for updatesthe email that i have given you is $emailemailbody;$success = mail($to,$title,$body,$headers);?> Link to comment Share on other sites More sharing options...
Synook Posted August 29, 2007 Share Posted August 29, 2007 Yes, you need the <?php there. Link to comment Share on other sites More sharing options...
The Sea King Posted August 29, 2007 Author Share Posted August 29, 2007 thanks.edited:I tryed it out but it doesn't want to email it....I get only an error...page...from...my...sever... Link to comment Share on other sites More sharing options...
Synook Posted August 30, 2007 Share Posted August 30, 2007 What does the error say? Link to comment Share on other sites More sharing options...
user4fun Posted August 31, 2007 Share Posted August 31, 2007 I tried the code again, it works just fine.I would like to kow what the error says. Link to comment Share on other sites More sharing options...
justsomeguy Posted August 31, 2007 Share Posted August 31, 2007 It's probably an error with the email server. If you are testing this on your local computer, you need to have an email server configured for PHP to use in php.ini, in most cases that means you need to also install an email server on your local computer that PHP can connect to. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.