Appnitro Software Forums » MachForm

BBC Email Address For All Submissions

(8 posts)

  1. Is there a way to customise our MachForms so that a submission automatically BBCs a particular email address- same one every time?

    Thanks!

    Posted 1 year ago #
  2. Yes, you might wan to check this post:
    http://www.appnitro.com/forums/topic/to-and-bcc-email-addresses?replies=4

    Posted 1 year ago #
  3. Only problem is that some forms go to multiple email addresses but we'll have only one BCC. Is there was a way so that the first email address was the BCC and then any others after that would be recipients? So would switching it around to this work...

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

    Posted 1 year ago #
  4. Yes, replace to these code would possible to send the first email as BCC and another as the receipient

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

    Do you found any problem with the changes ?

    Posted 1 year ago #
  5. So then I need to add this too?

    if($has_email){
    $send_status = $mail->Send();
    $mail->ClearBCCs();
    $mail->ClearAddresses();

    Posted 1 year ago #
  6. That block of code already exist, except for this line:

    $mail->ClearBCCs();

    so you only need to insert that one.

    Posted 1 year ago #
  7. Here is what I have from line 468 to 491:

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

    if($has_email){
    $send_status = $mail->Send();
    $mail->ClearBCCs();
    $mail->ClearAddresses();

    if($send_status !== true){
    echo "Error sending email: ".$mail->ErrorInfo;
    }
    }
    }

    I tried it out by entering three email addresses in the "Send notifications emails to" field. The first one was to be the BCC and then the other two were just normal email addresses. When I submitted the form, email address two and three got the form submission via email but not the first one (the BCC). Any ideas what am I missing that it is preventing the first email (BCC) from coming through?

    Posted 1 year ago #
  8. Hmm.. the code seems fine. Is it possible to send me your "helper-functions.php" file, so I can test it directly. You can send the file to here :

    customer.service[at]appnitro.com

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.