WordPress registration and contact form 7 [closed]
WordPress registration and contact form 7 [closed]
WordPress registration and contact form 7 [closed]
WordPress has a built in function for validating emails and I would advise you use that. So you can replace your preg_match with the wordpress is_email else if (!preg_match(“/^[A-Z0-9.%-]+@[A-Z0-9.%-]+.[A-Z]{2,4}$/”, trim($_POST[’email’]))) { $emailError=”You entered an invalid email address.”; $hasError = true; } REPLACED WITH else if ( ! is_email( trim( $_POST[’email’] ) ) ) { $emailError=”You … Read more
Ive done this before using both contact form 7 and Grunion Contact Form plugins, when using contact form 7 i created a new tag to send the email to the post author: //contact form 7 author email wpcf7_add_shortcode(‘author_email’, ‘wpcf7_expert_email_shortcode_handler’, true); function wpcf7_expert_email_shortcode_handler($tag) { if (!is_array($tag)) return ”; $name = $tag[‘name’]; if (empty($name)) return ”; global … Read more
Have you installed any other plugins? Also check in header.php that there is wp_head(); function in <head>wp_head(); </head> tag and wp_footer(); before </body> tags ends
Take a look at Contact Form 7 Dynamic Text Extension
The CF7 plugin uses WordPress built-in wp_mail() function which itself uses the PHPMailer class (github repo). The PHPMail github documentation states, The PHP mail() function usually sends via a local mail server, typically fronted by a sendmail binary on Linux, BSD and OS X platforms, however, Windows usually doesn’t include a local mail server; PHPMailer’s … Read more
You are actually closer in your first attempt. My recommendation would be to create a folder called “scripts” in the WP root and put your PHP script files in here as well as your attachment(s). You will then need to declare the full path in your action attribute as the script does not now share … Read more
I also (ab?)use comments for “private” replies to posts, like product inquiries, suggestions, answers to contests, … The advantage is that they are stored in the database and displayed in the interface without extra code from me (sometimes I add a filter to improve the formatting). Spam filtering and e-mail notifications are easy extras. I … Read more
A Must Use plugin could do the work. This is just an outline and has to be fully tested: add_shortcode( ‘global_form’, ‘shortcode_wpse_87634’ ); function shortcode_wpse_87634() { // Main site, ID=1, that has the form switch_to_blog( 1 ); // Do your stuff $my_stuff = something(); // maybe do_shortcode // Back to original site restore_current_blog(); // Return … Read more
The plugin WP-Mail-SMTP has always worked for me. This is with the Contact Form 7 and many others as it replaces the WP Mail functions directly. http://wordpress.org/extend/plugins/wp-mail-smtp/