send database info to email
I was wondering if sanyone c开发者_运维问答ould help me with the following:
I have some info inserted into mysql database on a couple of pages. After this is done I retrieve these info (in a new page) from the database and want to send them via email to various emails including one from the info from database.
I have built the email() function and "SELECT" all the info from the database (have them into some HIDDEN fields).
I am not sure how to go about getting these info sent via email.
I have tried, but all I get is an empty email with no info from database.
Hope I explained my problem and someone can give me clue about this.
Many thanks Francesco
MySQL does not include a feature for sending email. So you'll need to write additional software to handle the job for you.
One issue to decide, how will the email be requested? -- How will the process be initiated?
You could have your web page (written in PHP or any other language), which shows the information on the screen also send the email. See sending email from php.
A better performing idea is to first queue up your requests for sending emails. That way you won't slow down your web server. Then have a background job process each of the requests, reading the database and sending off the emails. Google for "php background processing" for help or ask more questions on StackOverflow.
Also, remember to check that your email is not being treated as spam.
Re: using the data from the database for sending the email--that's easy, just read the database, then use the information for creating the email's to, cc, subject and other fields.
精彩评论