Mail function is not working

You are passing $email where there should be attachments. Look at wp_mail arguments. Also you have not defined $to variable which in your case i assume should be $email. Try this, $name = $_POST[‘cuf_sender’.$n]; $email = $_POST[‘cuf_email’.$n]; $subject= $this->o[‘subpre’].’ ‘.$_POST[‘cuf_subject’.$n]; $msg = $_POST[‘cuf_msg’.$n]; $extra=””; foreach ($_POST as $k => $f ) if ( strpos( $k, … Read more

wp_mail file attachment not being placed in upload folder?

Attachments should always use the absolute filesystem path. Also to change the Content-Type of the email you should use the wp_mail_content_type filter. <?php function my_custom_email() { $to = ‘[email protected]’; $subject=”WordPress wp_mail”; $message=” <html> <body> <table rules=”all” style=”border-color: #666;” cellpadding=”10″> <tr>Hello WordPress</tr> </table> </body> </html> “; $attachments = array( WP_PLUGIN_DIR . ‘/my-plugin/uploads/sample_photo_01.jpg’ ); $headers[] = ‘From: … Read more

wp_mail() inside AJAX handler never returns

You can do some simple debugging: Try: wp_mail(‘youremail@com’, ‘123’, ‘123’); // to see if it will go through If #1 is not, check if you setup SMTP correctly // install a smpt plugin(wp smtp mail/easy wp smtp) and send a test email If you can’t send out a test email by plugin, check if your … Read more

Send notification to the admin when new custom post is submitted

EDIT – SOLUTION I got the solution using status ‘new_to_pending’ and adding the $auto object. function newpost_notify( $auto ) { $mailadmin = ‘[email protected]’; $subject=”Subject”; $headers=”MIME-Version: 1.0″ . “\r\n”; $headers .= ‘Content-type: text/html; charset=UTF-8’ . “\r\n”; $headers .= ‘From: xxx <[email protected]>’ . “\r\n”; $message=”There\”s a new post.’; wp_mail( $mailadmin, $subject, $message, $headers ); } add_action( ‘new_to_pending’, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)