Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

Beginner's Help Requested

the mail() function

Moderators: macek, egami, gesf

Beginner's Help Requested

Postby Gort Skoog » Tue Dec 03, 2002 10:20 am

Hello, forum mates (-;

A good friend of mine referred me to this forum saying "it's the best".

If you are any newer to PHP than I am, you're a fetus!

That said, I could use some help getting started. I have created the simplest possible email form, only three simple variables (name, email addy, message). I was advised to use a PHP script to send the info. A friend even created a short PHP script to get me started. It doesn't work.

I have been through several "simple tutorials for beginners" and I have to tell ya, these are teaching me very little and, modestly, I'm a pretty bright guy here.

Can some offer me a simple PHP script to send the email? My variables are $sendername for the sender, $senderemail for his/her email address, and $message for the message. The "send to" email address, for the purposes of this exercise, is "gort@skoog.net" (not a real email address).

I am not looking for a free handout. I'm certain that with the proper script, all the blanks will be filled in inside my head and the light bulb will appear above it. I learn by example and any help in this area will be deeply appreciated. I'm sure it will help me to understand the basics and put me on the path of creating more in depth scripts.

All the basics are covered, by the way. My host server DOES accept PHP and I do save my "action" address as *.php. On that topic, can I insert the PHP code directly onto a "Thank You" page? If so, will it be necessary to save that page as a *.php or can I save it as *.html and if so, will it still work?

Gratefully, I thank you in advance of some magnificent help (-;

Gort Skoog
Gort Skoog
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Dec 03, 2002 10:01 am

Postby Oleg Butuzov » Wed Dec 04, 2002 7:41 am

Code: Select all
<?
is (!isset($form))
{
echo "<form method=POST action=$PHP_SELF>
Nickname <input type=text name=nick><br>
Email <input type=text name=email><br>
<input type=text value=0 name=form>
<input type=submit value=send>
</form>";
} else {
$message = "$_POST[nick] entered email address $_POST[email]";
mail ("feedback@creative.net.ua", "feedback submission", $message);
echo "Thank you.";
}
?>


you can change this code for your needs.
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.