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

TO and BCC email addresses??


  1. deaddingo
    Member

    Hi.

    Is it possible to have the emails go to a TO email address, but then also have it BCC other email addresses as well?

    Cheers

    Posted 16 years ago #
  2. redityo

    Hi,

    Machform have not this feature yet, however you can do that manually by editing "includes/helper-functions.php". Search between line 475 ~ 482, you'll find this code :

    $has_email = false;
    foreach ($email_address as $email){
    	$email = trim($email);
    	if(!empty($email)){
    		$mail->AddAddress($email);
    		$has_email = true;
    	}
    }

    replace with this one

    $i = 1;
    $has_email = false;
    foreach ($email_address as $email){
    	$email = trim($email);
    	if(!empty($email)){
    		if ($i == 1)
    			$mail->AddAddress($email);
    		else
    			$mail->AddBCC($email);
    		$has_email = true;
                    $i++;
    	}
    }

    and don't forget to add this code on line 487

    $mail->ClearBCCs();

    next, what you have to do is set email notification on "email" menu setting with multiple email format (ex: test@test.com,test1@test.com). This modification will send first email as "TO Email" and next email with "BCC Email".


    MachForm Support

    Posted 16 years ago #
  3. jewelz24
    Member

    hello, I changed the code above as mentioned and it worked fine with "normal" email addresses. However i have an email address with the character "+" example: me+you@company.com When entering this email in the field i get the error: This field is not in the correct email format.

    Any workaround for this?

    Thank you!

    Posted 15 years ago #
  4. redityo

    Hi,

    I see "+" character would be a problem to mail validation. However to fix it, you need to edit "includes/common-validation.php" file and go to around line 207, you will see this code :

    error_message = VAL_EMAIL;

    then put these code exactly above that line

    $value[0] = str_replace($value[0],'+','');

    MachForm Support

    Posted 15 years ago #
  5. wpatters1229
    Member

    Have you since this email fixed the bcc issue so a person does not have to modify the code as shown here? Did not see any way in the current application

    Posted 13 years ago #
  6. wpatters1229
    Member

    I tried the manual changes but seemed to have broken the email so I reversed the change.

    Posted 13 years ago #
  7. spresser12
    Member

    We can get MachForm 3 to send to one email but if we add more than one email it errors out. In the past, we were able to alter the code so it would allow us to email the first address, and BCC the second, third, fourth, etc...

    Posted 12 years ago #
  8. yuniar

    We got your support ticket. We'll reply there.


    MachForm Founder

    Posted 12 years ago #
  9. jaygrabiec
    Member

    This is exactly what we are wanting to do, but we can't get it to work with the code provided earlier in this post and were wondering if there is still a way to accomplish this.

    Thanks,

    Jay

    Posted 12 years ago #
  10. jesseshowalter
    Member

    When i search the file "includes/helper-functions.php" I DO NOT find these lines of code, Why is this? Is it because of the version 3. When will all be sorted out, I need this functionality.

    Posted 12 years ago #
  11. yuniar

    Hi Guys,

    I've just posted an updated code to do the same thing for v3 here:
    http://www.appnitro.com/forums/topic/v3-to-and-bcc-email-addresses-modifications

    If you have any questions or found any problem, please reply there instead.


    MachForm Founder

    Posted 12 years ago #

RSS feed for this topic

Reply