Sending email from my php registration

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello there,

Can anyone tell me how to create a php script that when the user click
the Submit button, a message will be sent to friends email add stored
in mysql table?

I created this ff table structure using mysql ?

Field          Type              Size     Description

Name         Text              30        Your name
Email_add   Text              30        Your Email
F_name       Text             30         Your Friendís Name 1
F_name2      Text            30         Your Friendís Name 2
F_name3      Text            30         Your Friendís Name 3
F_Email         Text           30         Your friendís Email 1
F_Email2       Text           30          Your Friendís Email 2
F_Email3       Text           30         Your Friendís Email3

Note: After clicking Submit Button of the Registration.Php
         a message will be send directly to the email add stored in
         F_Email2, and F_Email3 fields.

How will I do this ? What function I need to send a message directly
to this 3 emails stored in this 3 fields Iíd mentioned ? I need help
ASAP. Thanks

-- /  This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL:
Visit Topic URL to contact author (reg. req'd).  Report abuse:

Re: Sending email from my php registration

rock72 wrote:
Quoted text here. Click to load it

Take a look at < .

Re: Sending email from my php registration

besides the mailing part (this is explained in the replies above) I have
to say this is a very dirty way of putting things in your database. Most
of the time people use only one table so they can do easy queries and
have nothing to worry about (the idea of creating two tables with a
'relation' scares some people to death I guess). What if you ever
descide people can have more than 3 friends? You have to extend your
database table and most probably have to change a lot of queries as well.

This is a tipical example of a relation. When you can say "<something>
HAS <something>", it's a relation for 99% sure. Because one person can
have several friends, and a friend can only belong to one person, this
is a many-to-one relation (from the person point of view) (sorry for
stupid ascii-art):

----------        ------------
| PERSON |        | FRIEND   |
---------- 1      ------------
| name   |---\    | name     |
| email  |    \  *| email    |
----------     \--| friendOf |

This whould already be a much better solution. However, I quickly have
to tell (before people start flaming me :P) that this is a bit stupid. I
mean person and friend are exactly the same table. Database tables
almost always represent how things are in real life. Is a friend
something else than a person? No! A friend IS a person. The same can be
said for database tables:

| PERSON   |
------------ 1
| name     |---
| email    |  |
| friendOf |---
------------ *

when a person has no friends (shit happens), leave the 'friendOf' field
to NULL or "" or something. If a person is a friend of someone, fill in
the 'friendOf' field.

In this solution, a person can be only friend of 1 person at a time. If
you want people be able to be friends with more people (many-to-many
relation) you will have to use a intermidiate table:

------------         ------------
| PERSON   |         | FRIENDOF |
------------1       *------------
| name     |---------| person   |
| email    |  \------| friendOf |
------------        *------------

a bit crappy this one. Both relations from friendof point to, both are oneToMany's (or manytoone's if you're looking from
the friendof table)

This way, people can have multiple friends (define and check in php if
you want to limit the maximum), and people can be a friend of multiple

I hope this helps you designing your database a bit better. If you're
not used to database relations, this might be a bit of a struggle - but
eventually it will save you hours of PHP-coding on finished projects =).

rock72 wrote:
Quoted text here. Click to load it

Site Timeline