Something like a mail form

Any problem with PHP can be disscused here
Post Reply
Kaky
Posts: 274
Joined: Tue Apr 18, 2006 7:43 pm

Something like a mail form

Post by Kaky »

I wonder if it could be possible that someone onters his mail and an auto formatted mail comes to him (so i do naot have to write him anything) for example you know something like "if you like this site why not tell your friend ......."

If somenone could post a script for it i would be wery thankfull. :D


Image

A funny picture -------> me , myself and i (too much for this world)
Flipper3
Posts: 353
Joined: Tue Feb 28, 2006 12:34 am

Post by Flipper3 »

I would like this as well or maybe an email validation script!
lokesh
Posts: 26
Joined: Sat May 13, 2006 11:40 am

Post by lokesh »

Hope I understood what you are looking for...a person enters his mail id and submits it, then a mail with pre-defined content is sent to him automatically without you doing anything.

Here is a simple one,

Code: Select all

<?php
if($submitform) {
$email = $_GET['email'];
$subject = "Thanks for visiting [your website]";
$message = "
Howdy!,

Your custom message here

--
-Regards,
[your name]

This email was automatically generated.
Please do not respond to this email.";

if(!mail($email,$subject,$message, "FROM: yourname <youremail>")) {
echo("Error processing your request");
}
else {
         echo "Thank you. Your email has been added to our database.";
}
}
else {
?>
<html><body>
<form action="" method="get">
Email:<input type="text" name="email">
<input type="submit" value="Submit" name="submitform">
</form>
</body></html>
<?
}
?>
Hope this is what you were looking for.
Kaky
Posts: 274
Joined: Tue Apr 18, 2006 7:43 pm

Post by Kaky »

yes it is what i was hoping to get (how many forms should i make?)
Image

A funny picture -------> me , myself and i (too much for this world)
tswpn
Posts: 212
Joined: Sat May 13, 2006 9:51 am

Post by tswpn »

There is a good site where you can make e-mail forms http://www.thesitewizard.com
lokesh
Posts: 26
Joined: Sat May 13, 2006 11:40 am

Post by lokesh »

The code posted above has both the form and the script to send mail, just save it as a single file. Just a single form is enough...
Kaky
Posts: 274
Joined: Tue Apr 18, 2006 7:43 pm

Post by Kaky »

thx man i am a total noob in html and do not know a single bit of php so i was a bit lost
Image

A funny picture -------> me , myself and i (too much for this world)
Post Reply