Blocs Form help for sending multiple emails

Is there a format in the Bloc form so we could use a primary, cc & bcc?

Send to mail@gmail.com, CC mailCC@gmail.com, BCC mailBCC@gmail.com

Would this work?
To: @gmail.com,Cc: @gmail.com,Bcc @gmail.com>

I appreciate anyone who can share that knowledge

You can send to multiple recipients by separating the email addresses with commas.

But this also only populates the to: header string. You would need to manually edit the form PHP to add Cc: Bcc: strings to the email header.

Also pretty weird to be sending a bcc from a contact form. But ok. :man_shrugging:

Thanks Pete :slight_smile:

I was hoping to do this in the Blocs Form. Manually editing the *.php means I need to keep the one I edited. I then have to upload that edited file to the exported "include "folder. Every time I export the project I do the same.

$to = 'To@gmail.com'; // Email submissions are sent to this email

// Create email

$email_subject = "Message from Form Test";

$email_body = "You have received a new message Form Test. \n\n".

"Contact_Name: $contact_name \nContact_Email: $contact_email \nContact_Phone: $contact_phone \nContact_Address: $contact_address \nContact_City: $contact_city \nContact_State: $contact_state \nContact_Zip: $contact_zip \nContact_Message: $contact_message \nContact_Optin: $contact_optin \n";

$headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n";

$headers .= "From: [From@gmail.com\n](mailto:From@gmail.com\n)";

$headers .= "CC: [CC1@gmail.com](mailto:CC1@gmail.com), [CC2@gmail.com\r\n](mailto:CC2@gmail.com\r\n)";

$headers .= "Bcc: [BCC1@gmail.com](mailto:BCC1@gmail.com), [BCC2@gmail.com\r\n](mailto:BCC2@gmail.com\r\n)";

$headers .= "Reply-To: $contact_email";

Why? If the form doesn’t change just exclude those files from uploading.

1 Like

I rewrote my earlier explanation. I hope this makes it more clear.

I was hoping to do this in the Blocs Form. Manually editing the *.php means I need to keep the one I edited. I then have to upload that edited file to the exported "include "folder. Every time I export the project I do the same.

I always welcome your willingness to help.

You can rewrite the question but the answer is the same. The sidebar in blocs for the email address only populates the To: string in the PHP file. You can send multiples but if you want Bcc you have to modify the PHP file.

You only have to do this once, and every time you update the site, exclude the file Blocs re-generates.

Makes sense to do this, but I still have to upload the edited version if I want it to be used in the updated website.

Only if you make changes to the form. Otherwise no.