More information in the "From "field of the email

Moulouk 03 Jan, 2008
Hello every one,

Thanks to the Chronoengine team for such a great component.
My question is this : In my form, I use separate fields for Name and surname (one field for each). In the email sent, I'd like to have Name + surname appearing in the "From" area of the email sent, followed by the email address. It seems that I can only have one field mentioned in the "From name field:" area of form config. How can I have Name + surname appearing there? Thanks for any help.
GreyHead 03 Jan, 2008
Hi Moulouk,

Try this: in your form html add a hidden field like
<input type="hidden" name="fromname" value="" />
this is just to create a placeholder for the fromname. In the Special Fields tab put fromname in the 'From name field' box. Lastly, in the OnSubmit, before email field put this code
<?php
$_POST['fromname'] = $_POST['firstname']." ".$_POST['lastname'];
?>
This should give the new value to the 'fromname' field.

Then turn debug on and check the results.

Bob

PS With some ISPs using the submitters email as the From Email Address may cause emails to fail.<br><br>Post edited by: GreyHead, at: 2008/01/03 18:18
Moulouk 03 Jan, 2008
It's working now. Thanks so much Bob. I really appreciate your support and help.
GreyHead 04 Jan, 2008
Hi Moulouk,

Great, well done, glad we could help.

Bob
This topic is locked and no more replies can be posted.