please help me out with this problem.I have a contact form like this:
<div class="contact form">
<form action="" method="get" class="formofcontact"/>
<p>To:
<label>
<select name="select" size="1" id="select">
<option>Select</option>
<?php
$mvo=new membersVO();
$mdao=new membersDAO();
$list=$mdao->fetchAll('onlypublished');
foreach($list as $members){?>
<option value="<?php echo "$members->email1" . "," . "$members->email2" . "," . "$members->email3";?>"><?php echo $members->name;?></option>
<?php
}
?>
</select>
</label></p>
<p>From:
<label>
<input type="text" name="textfield2" id="textfield2" /> </label>
</p>
<p>Subject:
<label>
<input type="text" name="textfield3" id="textfield3" />
</label>
</p>
<p>Message:</p>
<p>
<label>
<textarea name="textarea" id="textarea" cols="45" rows="5"> </textarea> </label>
</p>
<p>
<label>
<input type="submit" name="button" id="button" value="Send" />
</label>
</p>
</form>
Now if someone wants to send email to australian representative then they select australia and they write thir email in the from textbox.Now what i am confused is to send the email in the respective email addresses selected by the viewers.
Please guys help me out.
Here are a few points
1- Use
method="POST"instead of GET in your<form>for sending large data like an email.2- Do not put actual email addresses inside
<option>‘s value that will reveal those emails to SPAM email crawlers, just put member’s id or the name itself in there:then when you receive the data find that member and get its email:
and to send the email: