cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Coding help for BCC function requested
May 11, 2007
9:01 pm
Tyler
Guest

Greetings,

I asked about the possibility of making a bcc feature in addition to the cc feature in the blog comments and these are the instructions that I got.

Generally, you can quite easily go into the code and add a BCC field to the email header (in case you choose not to use the built in CC-option):

look for the below statement (lines ~468 & 910, 931):
$headers.= "Reply-To: " . $field_email . $eol; and add a$headers.= "BCC: " . $field_email . $eol; and/or change $field_email to whatever specific email address you want.

I am obviously not a programmer at all and I am having troubel figuring out how to do this. 

Any assistance would be greatly appreciated.

Thank you in advance.

May 11, 2007
9:28 pm
Tyler
Guest

OK,

I cahnged the code to this at the first spot (~468)…is this correct?

  1. // ready to send email
     // email header for regular email
     $eol = "\\n";
     $headers = "From: \\"".get_option('blogname')."\\" <wordpress@" . preg_replace('#^www\\.#', '', strtolower($_SERVER['SERVER_NAME'])) . ">" . $eol;
     $headers.= "Reply-To: " . $field_email . $eol;
     $headers.= "BCC: " . $field_email . $eol;
     $headers.= "MIME-Version: 1.0"  .$eol;
     $headers.= "Content-Type: text/plain; charset=\\"" . get_option('blog_charset') . "\\"" . $eol;

I still can't figure out how to alter the two remaining areas…assuming that this is even correct…

May 12, 2007
7:52 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

That looks about right. If you want to make the BCC dependent on the "CC:"  form input field, you may want to add an IF :

if( $ccme )
     $headers.= "BCC: " . $field_email . $eol;

You should also disable the code block below // send copy or notification?, otherwise the visitor will end up getting two emails!

And finally you need to do all the above also for the non-AJAX version which you'll find further down the code. Just search for the other // send copy or notification?

May 12, 2007
4:20 pm
Tyler
Guest

Oliver,

Thank you for the reply.

I am totally lost when trying to code…I have no background at all.

However, I will give your suggestions a try and see what I can come up with.

If you don't mind, I will post my changes here for you to take a glance at.

Thanks again for your help.

Regards,

Tyler 

May 14, 2007
3:22 pm
Tyler
Guest

Oliver,

Just thought I'd let you know I didn't give up on this, but I have an exam on Wednesday…probably get around to this again next weekend.

Thanks for your help!

Tyler 

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
40 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3762

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5361

Posts: 18742

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)