• Hello,
    I can’t send email from my server, I receive this error :
    An error has occurred when trying to send this email:
    ? Could not instantiate mail function.
    So I made a fresh install on https://dev2.switchonpaper.site/ with no plugins and default theme, same error.
    PHP mail function is working normally on this environment.
    Do you have any idea ? Thanks for your time.

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Check with your host. Your host probably don’t have mail() setup to send email.

    Thread Starter bromatebro

    (@sophabed)

    Hello,
    Thank you for your response.
    Mail function works on this server, WordPress core is correctly sending mails abouts accounts and admin tasks. Front contact forms are working.
    The phpmail logs don’t show any error but mails are not sent with WP-EMail.
    Thank you for your help.

    Thread Starter bromatebro

    (@sophabed)

    Hello,
    I found the solution.
    I saw in my php mail() logs that From: wasn’t set in mail headers.
    The field “Your E-Mail” must be activated in order to have the From: correctly filled.
    There is no fallback to admin or current user email if empty no ?
    In my case I would love if it could fallback to current user as only logged-in users see the Wp-email link.
    Is there a filter hook or something ?
    Thank you for your time and help.

    Plugin Author Lester Chan

    (@gamerz)

    Sorry, there is no hook because the plugin is not designed for that use case.

    You can modify the code and hardcode it here https://github.com/lesterchan/wp-email/blob/master/wp-email.php#L950

    Thread Starter bromatebro

    (@sophabed)

    Hello,
    Yes thank you, I will go for my mod as it’s not a big plugin to maintain.
    Thank you for all the job you made with this plugin.
    Have a great day.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Could not instantiate mail function’ is closed to new replies.