This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

[closed] Reply-to Address


  1. dustin
    Member

    Is there a way to make it so the Reply-to Address for the email is taken from the 'Email' field? Right now if you hit 'reply' to a email sent from MachForm it will reply back to the admin email not the sender.

    Posted 17 years ago #
  2. yuniar

    On line 433-435 of helper-functions.php you will find this code:

    $mail->Host     = "127.0.0.1";
    $mail->Mailer   = "mail";
    $mail->CharSet  = 'UTF-8';


    Below that code, add this line:

    $mail->ReplyTo  = $table_data['XXXX'];


    Change the XXXX with your form's email field name. View source your form to see it. Usually it will be something like element_2

    Let me know if you have any difficulty.


    MachForm Founder

    Posted 17 years ago #
  3. CMSports
    Member

    try this.. the reply email is changed, but no where near what it should be when the user leaves their email address in a field that is * requre *
    this is what I have now

    $mail->Host = "127.0.0.1";
    $mail->Mailer = "mail";
    $mail->CharSet = 'UTF-8';
    $mail->ReplyTo = $table_data['element_9'];

    when I view source for view.php.. I see this

    <label class="description" for="element_9">Email Address: <span id="required_9" class="required">*</span></label>
    <div>
    <input id="element_9" name="element_9" class="element text medium" type="text" maxlength="255" value=""/>

    is it me or am I missing something..

    DY

    Posted 17 years ago #
  4. yuniar

    I'm sorry, but I don't really understand what you mean.

    So the ReplyTo is not working for required field?


    MachForm Founder

    Posted 17 years ago #
  5. CMSports
    Member

    The replyTo... when I do nothing to the code. hitting the reply, send email to my address.. changing the code. above.. will send a relpy to different email address not the one I typed in.. on the form itself. and submitted..

    DY

    Posted 17 years ago #
  6. yuniar

    That's odd. Can I take a look into your MachForm admin panel?

    Please send me the detail (URL, user+password) to customer.service [at] appnitro.com


    MachForm Founder

    Posted 17 years ago #
  7. loophole
    Member

    What if I have more than one form that I would like this to work with - for example one form has element_2 as the email field, but another has element_6

    Posted 17 years ago #
  8. yuniar

    Hi loophole,

    You are right, it won't work with multiple forms.
    To do that, you will need to add conditional code, so the whole code would be like this:

    $mail->Host     = "127.0.0.1";
    $mail->Mailer   = "mail";
    $mail->CharSet  = 'UTF-8';
    
    if($form_id == 3){
    	$mail->From = $table_data['element_2'];
    }else if($form_id == 4){
    	$mail->From = $table_data['element_6'];
    }


    Adjust the form id and element id value as needed.


    MachForm Founder

    Posted 16 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.