views:

18

answers:

1

Hi guy, I was wondering if sanyone could 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

A: 

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.

Larry K
Hi Larry, thank for your feedback an apologies for this late reply.What I am doing is what you mention in the last point.I have all datas in hidden fields and want to send them via email.Althought the email function seems to be correct, no information from the hidden fields are included into the email sent.What I am trying to understand is why is this happening.If you could give me a firhter help it would be really appreciated.Francesco
francesco
You shouldn't be storing the db values in hidden fields. Your php script should read the db, then send the email with the data. You should not be sending the data back to the browser. If you're still having problems, then you should ask a new question to stack overflow.
Larry K