Page 1 of 2
How to get a email notification upon new submit?
Posted: Thu Jul 15, 2004 7:35 am
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?
Posted: Thu Jul 15, 2004 7:38 am
by malcolmboston
theres dozens of e-mailing scripts (of which i've wrote many) search the forums
Posted: Thu Jul 15, 2004 7:56 am
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.
Posted: Thu Jul 15, 2004 8:56 am
by hawleyjr
malcolmboston wrote:theres dozens of e-mailing scripts (of which i've wrote many) search the forums
Posted: Thu Jul 15, 2004 9:11 am
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);
Posted: Thu Jul 15, 2004 9:15 am
by Lucnet
Thanks, easy enough.

Posted: Thu Jul 15, 2004 12:09 pm
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.
Posted: Thu Jul 15, 2004 12:38 pm
by feyd
send an email when you insert (successfully) the testimonial to approval..
Posted: Thu Jul 15, 2004 12:47 pm
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.
Posted: Thu Jul 15, 2004 1:46 pm
by feyd
[php_man]mysql_affected_rows[/php_man]() and [php_man]mail[/php_man] returns false if it failed, I believe.
Posted: Sat Jul 17, 2004 2:36 pm
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.
Posted: Sat Jul 17, 2004 2:43 pm
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.
Posted: Sat Jul 17, 2004 2:46 pm
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.
Posted: Sat Jul 17, 2004 3:00 pm
by AVATAr
did you do the script to "approve"?
Posted: Sat Jul 17, 2004 3:36 pm
by Lucnet
Yes I did. With the help of this forum that is.
