• Resolved Nirmal Kumar

    (@onlinerockers)


    I installed WP Mail SMTP plugin and integrated it with Gmail.

    But when I tried to use wp_mail(); inside my functions.php file to send emails, the emails are not going.

    Could you help me understand what is the actual error?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @onlinerockers,

    Are the test emails sent successfully from WP Mail SMTP > Email Test? Could you please share the full custom code you’re running on functions.php?

    Thanks!

    Thread Starter Nirmal Kumar

    (@onlinerockers)

    Yes, the test email is being sent successfully.

    This is the exact code I used in the functions.php

    add_action('init','payuoc_test_email');
    
    function payuoc_test_email(
        
        wp_mail("[email protected]","testing email","sample content");
    );

    Hi @onlinerockers,

    Thanks for the details. The exact code you’re using in functions.php is not a valid PHP syntax. Please check with the code below:

    add_action('init','payuoc_test_email');
    function payuoc_test_email() {
       wp_mail("[email protected]", "testing email", "sample content");
    };

    I hope this helps!

    Hi @onlinerockers – We haven’t heard from you in about a week, so I’m going to go ahead and mark this ticket resolved. If you still have questions, though, please feel welcome to continue the conversation.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Not sending emails with wp_mail()’ is closed to new replies.