• Resolved yusefkalhor

    (@yusefkalhor)


    hi

    i have a problem with sending email in wordpress using smtp in my custom form. i have this code to send email. but its not working.

    this is my code:

    // send email to user
    $template = file_get_contents(FORM_TPL."user/contact_us/user_email.php", true);
    $headers[] = 'Content-type: text/html; charset=utf-8';
    $headers[] = 'From: '.get_bloginfo("name").' <'.get_bloginfo("admin_email").'>' . "\r\n";
    wp_mail($email,'contact us',$template,$headers);

    my question is: how to send an email with html template in smtp?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Darshana

    (@darshanaw)

    Hi @yusefkalhor,

    Thanks for reaching out! Could you please share the error log or debug information with us? This will help us assist you more effectively.

    Please follow this guide on how to enable error logging in WordPress.

    Ensure that the “From” email address in your custom code matches the “From” email address configured in your WP Mail SMTP plugin.

    Additionally, you can check the WP Mail SMTP debug information under WP Mail SMTP -> Tools -> Debug Events. For more details, please refer to this guide.

    I hope this helps. Thank you!

    Thread Starter yusefkalhor

    (@yusefkalhor)

    i activate the debug mode and show this error

    Notice: ob_end_flush(): failed to send buffer of zlib output compression (0) in /home/ghnmco/public_html/wp-includes/functions.php on line 5464

    i think this is for wordpress not plugin

    Plugin Support Darshana

    (@darshanaw)

    Hi @yusefkalhor,

    Thanks for getting in touch! Could you please also check the Debug Events section as I mentioned before, and see if there is a failed event? If an email was triggered and failed, you should be able to find more details within that failed event description.

    If you require further assistance, please provide the code from your other file, “user_email.php,” so that I can check with our developers.

    In case it helps, you can use a tool like this to share your code.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.