Forums

add button to send mail...

priamo 10 Jun, 2010
hello,
in a table that is filled with chronoforms, ask users to enter their email address ... I would like to add a button that sends an email to the address indicated by user. I tried writing this code:

$a = $myRow-> email;
$subject = "test ok";
$message = "confirmed";
$headers = "From: [email]example@example.example[/email];
$ok = mail ($ to, $ subject, $ message, $ headers);


I have inserted this code under click of the button "EDIT" (because I do not know another place) but I send the message to all addresses found in the table, and not only that corresponding to the button.
Help me ...
GreyHead 10 Jun, 2010
Hi priamo,

You'll need to create a new link in the page. The simple way is to use a 'mailto' link like
<a href='mailto:{email}?subject=test%20OK&body=confirmed'>Email</a>
Otherwise you'll need to add a submit button to each line and check the result on submit (or build an Ajax link) both are more complicated.

Bob
priamo 10 Jun, 2010
Thanks...
wzacharias02 07 Jul, 2010
< form method="post" action="mailto:youremailatemail.com">
<textarea rows="5" cols="20" wrap="physical" name="comments">
Enter Comments Here
</textarea>
<input type="submit" value="Email Me">
</form>

simply place your email where it says:youremailatemail.com
and remove the space between "<" and "form" in the first line

hope that helps.

William
Sports Products Blog
palazah 18 Jul, 2010
Thanks William.
I was facing the same issue and by using your code, i solve my problem.
thanks again.
This topic is locked and no more replies can be posted.