Articles of phpmailer

Why wp_mail() function isn't sending any emails and displaying '0' in Chrome 'Network' response

I’m trying to send emails through wordpress using wp_mail() function and it doesn’t seem to work. It’s displaying 0 in Chrome ‘Network’ response with Status Code:200 OK this my code part: // Contact form Ajax add_action(‘wp_ajax_nopriv_submit_contact_form’, ‘submit_contact_form’); function submit_contact_form(){ if(isset($_POST[’email’])) { $email = $_POST[’email’]; $email_to = “info@company.com”; $host = “ssl://smtp.gmail.com:465”; $username = ‘myEmail@company.pro’; $password = […]

wp_mail not sending emails

I have used WP-Mail-SMTP to setup the mailer on my WordPress installation. I have tested it by sending email to my private mail. I am now trying to send the form data using wp_mail() function[WP]. Below is the code. <?php if(isset($_POST[“button_pressed”])){ // Checking For Blank Fields.. if($_POST[“dname”]==””){ echo “Fill All Fields..”; } else { $email=$_POST[’email’]; […]

Create mail form using PHPmailer

I’m learning about coding plugin. I trying to create a form in plugin page and it can send mail. This is my code, but it doesn’t work(I did not receive email and did not show any error). add_action(‘admin_menu’, ‘add_contact_us_page’); function add_contact_us_page() { add_menu_page( __( ‘Contact Us’, ‘textdomain’ ), __( ‘Contact Us’,’textdomain’ ), ‘manage_options’, ‘support_form_page’, ‘support_form’, […]

Should I use wp_mail or PHP's mail?

This question already has an answer here: What is the advantage of using wp_mail? 1 answer

Contact Form 7 not sending emails- no confirmation, no error

Live site. I’ve noticed that Contact Form 7 recently stopped working, despite my not having touched any of the settings. What’s odd is that I receive neither a confirmation nor an error message; I click “send” and nothing happens. This problem persists across FF, Safari, and Chrome. I read in other, older threads that it […]

Emailing passwords: Setup installed on home server using XAMPP

I’ve just delved into the WP world and all in all it’s going quite well. I have a server at home that I’m using to host the sites. All is working fine except the password emails are not being sent when a user registers. I’ve hunted quite a lot online but none of the posts […]

Setting Custom Email From name and email address in wp_email()

I am writing a custom plugin that sends an email to users from admin/front end section. I am using wp_email() to send emails and emails are being sent fine. I am testing this on a plain WP installation with only my plugin installed and hostgator as my hosting server. Whenever the email is sent, the […]

Using SMTP for outgoing mails (PHPMailer) on AWS instance?

I moved one of my wordpress site to an AWS instance. But once I got it working, noticed that none of the notifications or contact emails were being sent through. On researching the issue, I found that if I set the SMTP server to be an external SMTP (my AWS instance doesn’t have one), it […]

Why “Contact Form 7” doesn't update PHPmailer library?

I realized that popular WordPress plugin Contact Form 7 uses this library https://github.com/PHPMailer/PHPMailer. When I check source of mail, which has been sended from Contact Form 7, it looks like this: X-Mailer: PHPMailer 5.2.14 (https://github.com/PHPMailer/PHPMailer) X-WPCF7-Content-Type: text/plain So, this version is from (Nov 1st 2015). https://github.com/PHPMailer/PHPMailer/blob/master/changelog.md The latests one is: Version 5.2.18 (December 24th 2016) […]

What's the easiest way to setup SMTP settings programmatically?

Assume we have blank WP site and we want to setup SMTP settings programmatically in our plugin or theme. What’s the easiest way to do it without changing core files?