If I connect my own SMTP server to wp_mail, reset password doesn’t works anymore
A “$” character in my password seems to be guilty … Fix the issue by replacing: $phpmailer->Password = “xxxxx$xx”; by $phpmailer->Password = ‘xxxxx$xx’;
A “$” character in my password seems to be guilty … Fix the issue by replacing: $phpmailer->Password = “xxxxx$xx”; by $phpmailer->Password = ‘xxxxx$xx’;
f you’re using anything that allows you to configure SMTP within WordPress, take it out. Then put everything into a function: add_action(‘init’,’delay_until_init’); function delay_until_init(){ // call wp_mail() here }
You don’t need to pass the from name and email to PHPMailer in your code as it will take it from $headers so try the following: add_action( “phpmailer_init”, “send_smtp_email” ); function send_smtp_email( $phpmailer ) { // ini_set(“sendmail_from”,”[email protected]”); // ini_set(“sendmail_path”,”[email protected]”); // Define that we are sending with SMTP $phpmailer->isSMTP(); // The hostname of the mail server … Read more
Try code below. <?php $attachments = array(); array_push($attachments, WP_CONTENT_DIR . ‘/uploads/my-first-attachment.docx’ ); array_push($attachments, WP_CONTENT_DIR . ‘/uploads/my-second-attachment.zip’ ); $to=”[email protected]”; $subject=”Online: multiple attachment demo through wp_mail of wordpress”; $message=”This is testing”; $headers=”From: NAPSWI online <[email protected]>”; get_header(); if( wp_mail( $to, $subject, $message, $headers, $attachments) ) { // the message was sent… echo ‘The test message was sent. Check … Read more
Asynchronous emailing
No, hooks have nothing to do here, all the emails you mentioned (WordPress Gravity Forms and WooCommerce) use the same function wp_mail. I strongly believe this is blocked outside of WordPress, and I suggest you use a SMTP server with a real email address, you can use Postman SMTP Mailer/Email Log which will also help … Read more
Have you tried without the ajax? Is that where you’re actually sending the mail? Try just putting the wp_mail function right under headers and see if you get the mail. Also i agree with theDeadmedic. It could be spam. Check the google spam folder and if its’ not there, try sending to an email on … Read more
While wp_mail() is not exactly forbidden in a theme, it is very likely misplaced there. The purpose of a theme is presentation. It should not change existing data, and it should always be easy to replace. That’s the reason why contact forms, polls, shops, tracking and similar functionality is pure plugin territory. There is no … Read more
Honestly, this also has nothing to do with WordPress. It is more web server whitelisting issue. You should start with this link. SPF records are important. And maybe your web server has IP address that is blacklisted. You may even consider different IP address from your provider.
Seem like You are not using the correct variable name in $status = wp_mail( $ecard_recipient, $subject, $message, $headers ); You are getting email of recipient in $recipient and in wp_mail() function you are passing another variable for recipient email. So, i think this must be the issue you are getting empty variable.