Hi I have made a simple helping tool to make it easier for me to awnser peoples problems and but I have been so far able to gather the users information with a form that collects their name, email, subject & problem (also ip & date) and this is all saved in a database with the empty field called reply which is left for the admins to fill in... All I have been able to complete is the admin being able to fill in the reply but I want it to send to the users email with this kind of format:
To: [email they put in to the database] Subject: RE: [subject they put in to the database] Hi [name they put in to the database], Thanks for contacting us about this problem! [problem they put in to the database] [reply that admin put into the database] [date in that was in the databse]
To: [email they put in to the database] Subject: RE: [subject they put in to the database]
Hi [name they put in to the database],
Thanks for contacting us about this problem!
[reply that admin put into the database] [date in that was in the databse]
So pull the data from the database and use [man]mail/man.
Ok thanks but I need help with some code
With what part, sending the email? Retrieving the data from the database? Building the message body text?
How to I retrive the data I have not got the mind to work it out 🙁 I know how to work the mail() feature so thats ok
"and this is all saved in a database"
Well, what kind of database? MySQL? If so, do you know how to construct a SELECT query that will suit your needs? If not, we can't help much without knowing the fieldnames in your MySQL table...
id, name, email, subject, ip, date, reply
thats all of them 😃
edit: its mysql