Hi All,
My situation is this:
I am running a CMS system where each category represents a market place, each market place has it's own email address defined in the database. I would like a form to be placed in each category that sends to the email address specified in the database.
Where I am at the moment:
I have successfully gotten PHP DynaForm to do this but PHP DynaForm does not send emails in a nice html template so I would like to use formmail from: http://www.tectite.com/
My code surrently looks like this and does not work:
<?php if($page[adminemail]) {
printf( "<form method=\"post\" action=\"http://www.marketsonline.com.au/contact_m_admin/formmail.php\" name=\"SampleForm\">
<input type=\"hidden\" name=\"env_report\" value=\"REMOTE_HOST,REMOTE_ADDR,HTTP_USER_AGENT,AUTH_TYPE,REMOTE_USER\">
<input type=\"hidden\" name=\"recipients\" value=\"%s\" />
<input type=\"hidden\" name=\"required\" value=\"email:Your email address\" />
<input type=\"hidden\" name=\"subject\" value=\"Sample FormMail Testing\" />
<table border=\"1\" cellspacing=\"5%\">
<tr>
<td>
<p>Please enter your name:</p>
</td>
<td><input type=\"text\" name=\"realname\" />
</td>
</tr>
<tr>
<td>
<p>Please enter your email address:</p>
</td>
<td><input type=\"text\" name=\"email\" />
</td>
</tr>
<tr>
<td><p>May we contact you?</p>
</td>
<td>
Yes <input type=\"radio\" name=\"contact\" value=\"Y\" checked />
No <input type=\"radio\" name=\"contact\" value=\"N\" />
</td>
</tr>
<tr>
<td valign=\"top\">
<p>Please enter your message:</p>
</td>
<td><textarea name=\"mesg\" rows=\"10\" cols=\"50\"></textarea>
</td>
</tr>
<tr>
<td><input type=\"submit\" value=\"Submit\" /></td>
<td></td>
</tr>
</table>
</form>",$page['adminemail'],$page['title']);
} ?>
I have also attached my formmail script. As you might know the email addresse used on the form also have to be defined in formmail but formmail doesn't seem to like what I'm doing. The line in question is 2958.
If someone could tell me what I am doing wrong or suggest a better / easier method I would be so damn happy!