New answers tagged

0

I personally wouldn't use the wp_mail-function, nor the php mail-function. Both of them don't give you much control over your email. If you want to send HTML emails it's a good idea to send a plain text mail with it, so that users that are unable to read HTML emails can read your message too. Have a look on phpmailer that's a very good email sending class ...


1

Try this one. add_filter( 'wp_mail_content_type', 'wpdocs_set_html_mail_content_type' ); $to = 'sendto@example.com'; $subject = 'The subject'; $body = 'The email body content'; $headers = array('Content-Type: text/html; charset=UTF-8'); wp_mail( $to, $subject, $body , $headers); // Reset content-type to avoid conflicts -- ...


0

YIKESSSSSS. There is a lot of things wrong. You must sanitize $_POST data or very very bad things will happen... Its best to use single quotes for strings in WordPress Spacing and indentation does not follow best practices. Your not doing anything with $_POST['name'] ??? Your calling $_POST["email"] but not passing it through the example form which will ...


0

After fiddling around for hours, I found the problem. It was the form not the PHP. <div class="col-sm-6"> <input class="form-control" type="text" placeholder="ENTER DOG'S NAME" id="dname" /></div> <div class="col-sm-6"> <input class="form-control" type="text" placeholder="ENTER OWNER'S NAME" id="name" /></div> id ...


0

I have checked your code. I think header not defined properly.Please check the code below: $current_user = wp_get_current_user(); $name = sanitize_text_field($_POST["name"]); $email_address = sanitize_email($_POST["email_address"]); $detail = esc_textarea($_POST["detail"]); $message = "Name : " . $name . "\n"; $message .= "Email ...


0

I would explore the use of scheduled events in WorPdress, known as wp-cron. Here is a example for that (not tested, just written here as proof of concept): // 1.- Register custom escheduled event on plugin activiation register_activation_hook( __FILE__, 'cyb_plugin_activation' ); function cyb_plugin_activation() { if( ! wp_next_scheduled( '...



Top 50 recent answers are included