473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Sending email from my php registration

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_Email,
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

--
http://www.dbForumz.com/ This article was posted by author's request
Articles individually checked for conformance to usenet standards
Topic URL: http://www.dbForumz.com/PHP-email-re...ict177565.html
Visit Topic URL to contact author (reg. req'd). Report abuse: http://www.dbForumz.com/eform.php?p=596658
Jul 17 '05 #1
3 2925
rock72 wrote:
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_Email,
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

Take a look at <http://es2.php.net/manual/en/ref.mail.php>.
Jul 17 '05 #2
First, you have to have capture the Subject and the Email message body
via an HTML form. Write a PHP script and post your form to that
script. Your PHP script have to get a list of recipients from your
db table and then use those recipients in the php mail function.

Jul 17 '05 #3
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
person.name, 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
people.

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:
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_Email,
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

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Fazer | last post by:
Hello, Can anyone point me to a way on how to send a SMS message using Python? Thanks,
12
by: Joe_Black | last post by:
Hi all, I have googled this and found some answers but none that give me exactly what I'm after, maybe someone here can help. I have an app that will be distributed to users for their laptop...
5
by: Bert Bos | last post by:
Hi, when users are register on our website, their username, encrpyted password and so on are stored in the mySQL database. Many phpbb sites though send an activation mail to the email address...
8
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New...
3
by: dtvuser | last post by:
Hi, I'm new to PHP and seem to be having soom problems, I'm getting confused with all the different styles of script writing. I've created a PHP script to submit details to my email but the...
1
by: KUTTAN | last post by:
I am trying to send emailes ,but it leades to exeption the exeption message is "Failure sending mail." Try Dim message As New MailMessage()
2
by: Allie | last post by:
Hi, all. I'm new to C# programming. I'm even newer to programming email capabilities into my code. What I need to do is create three (3) functions: * sendEmail, using a Mail object (which needs...
6
by: ssankar | last post by:
hi all - I have been tasked to send customized emails to a set of users based on a certain condition in my company. ( This is NOT SPAM ) I have used MIME::Lite successfully to send html...
8
by: nargis2009 | last post by:
Hi, I have been encountering problems with my web page which is supposed to send email, and wondered if anybody can help find error. Initially I had all codes in one page and on click of...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.