How to get a email notification upon new submit?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

How to get a email notification upon new submit?

Post by Lucnet »

How do I implament a email notice into a script. I have a script that is very simple, but using MySQL to store the testimonials. I would like to get a email notice once a new person submits a new testimonial. How can this be done?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

theres dozens of e-mailing scripts (of which i've wrote many) search the forums
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Sorry I didn't mention this before. I would also like it to notify the customer once I approve the testimonial. Letting them know that it was approved and have a link telling them where to go, if they want to look at it.
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

malcolmboston wrote:theres dozens of e-mailing scripts (of which i've wrote many) search the forums
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

and http://uk2.php.net/manual/en/function.mail.php

All you basically need is:

Code: Select all

mail("me@me.com", "Somebody posted something.", "Somebody posted some data to the site at 15:11.");
//mail(to, subject, message);
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Thanks, easy enough. :D
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Well I thought it was easy enough. How do I get my script to see this and know to sent when a new testimonial is added.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

send an email when you insert (successfully) the testimonial to approval..
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

As I have mentioned I am very new with php and maybe I just don't understand what you are saying. How do I tell it that it was successful and it send the email.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]mysql_affected_rows[/php_man]() and [php_man]mail[/php_man] returns false if it failed, I believe.
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

The way this is looking is that the only way the email will work is if I add the persons email in the script. I am wanting it to email the person of a testimonial I approve. So when I appove it, the script will add the clients email address to the mail script and send it to them.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

we understand what you are looking for.
What is the problem? did you try doing the script and it didnt work.. or you want us to do it? i dont thing its the second one.
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

The biggest thing is I am new with php and I am not real formilar with the mail functions yet. I don't know how to put the mail code in the script. Does it go on the same page as the approval page or in the config file?

I am sorry that I am so blank about this.
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

did you do the script to "approve"?
User avatar
Lucnet
Forum Commoner
Posts: 61
Joined: Sat Jun 26, 2004 5:28 pm
Location: Alabama
Contact:

Post by Lucnet »

Yes I did. With the help of this forum that is. :lol:
Post Reply