5
Contributors
4
Replies
17
Views
1 Year
Discussion Span
Last Post by dean8710
0

Do you have any code that ypu've written. So the community can know what you need.
Php code and mysql schema.

0

Look up PHPMailer, in my experience it really is the best option. You can of course use the php mail() function, however, it does depend on a local mail server, wheras PHPMailer can connect through SMTP. https://github.com/PHPMailer/PHPMailer

Once configured correctly, you can easily make calls to PHPMailer to construct a message. Simply place that code once your database function returns true.

1

If you doubt is who to know when to send an email, i see two options for you:

  1. Use cron jobs that will run at specific intervals, identify the new records and send the e-mail. This way you can do it easily with PHP but you'll need to have some flag to know if that record was already mailed or not.

  2. Use a trigger on your SQL Server that will run and external command (probably call your PHP mailing page) each time a record is created.

0
<?php
//query insert new record

//if(//inserted successfully){
    //send email
    if(//email_was_sent){
        //inform_user
    }
}
else{

}

?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.