Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,414 members, 7,781,196 topics. Date: Friday, 29 March 2024 at 10:30 AM

Php Form To Email Script - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Php Form To Email Script (1250 Views)

Connecting Your Form To Interswitch Webpay / Get Your Form To Email Script With Auto-responder Facility. / Code For Send Form Content To Email Using Php (2) (3) (4)

(1) (Reply)

Php Form To Email Script by jozzy: 11:48am On Feb 06, 2007
Can any one help me out how can i get php form to email script, and put on, on how to put on the code
Re: Php Form To Email Script by uspry1(f): 12:25am On Feb 07, 2007
Create PHP-based email form script

First, PHP must be configured correctly in the php.ini file with the details of how your system sends email. (change your smtp outgoing mail, and email address) Open your PHP.ini in a text editor then find the section headed [mail function]. The configuration for Windows should look like this:


[mail function]
; For Win32 only.
SMTP = smtp.yourdomain.com

; For Win32 only.
sendmail_form = yourusername@yourdomain.com


or the configuration for LINUX should like this:

[mail function]
; For Win32 only.
SMTP =

; For Win32 only.
sendmail_form =

; For Unix only.
sendmail_path = /usr/lib/sendmail -t


Second, save your PHP.ini and close the window.

Third, copy the code that creates HTML form script to be pasted in a text editor or HTML editor as follow:


<html>
<head>
<title>Feedback Form</title>
</head>
<body>
<form action="feedback.php" method="POST">
Name: <input type="text" name="username" size="30" />
<br><br>
Email: <inpurt type="text" name="useraddr" size="30" />
<br> <br>
Message: <textarea name="comments" cols="30" rows="5"></textarea>

<input type="submit" value="Send Form">
</form>
</body>
</html>


Fourth, save as "feedback.html".

Fifth, copy the code that creates PHP script in a text editor, PHP editor or Dreamweaver with PHP extension plugs-in as follow:

<?php
    #recipient's email address
    $to = "yourusername@yourdomain.com";

   #subject of the message
   $re = "Website Feedback";

   #message from the feedback form
   $msg = $comments;

   #send the email now,
   mail($to,$re,$msg);
?>

<html><head><title>Message Received</title></head>
<body>
<h3>Thanks for your comments</h3>

Message received from <?php echo($username); ?><br>
Reply to <?php echo ($useraddr); ?>
</body></html>


Finally save as "feedback.php", then upload two files "feedback.html" and "feedback.php" to your web hosting server in the html directory folder (where you place all html files). That's it! Your feedback.html runs on the web page ready! You can test to submit your feedback form yourself. You should receive the form result directly to your email address.
Re: Php Form To Email Script by jozzy: 3:08am On Feb 07, 2007
Thanks a lot i will try that

(1) (Reply)

Joomla 1.5 Is Stable / Cheap Domain Name And Instant Setup With Interswitch Cards. / How To Pay Online (wordpress)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.