roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.51k stars 607 forks source link

Mailgun email issue #406

Closed dischord01 closed 9 years ago

dischord01 commented 9 years ago

I am able to send test emails from my server but not through wordpress. I get this error;

The e-mail could not be sent.
Possible reason: your host may have disabled the mail() function.

here is a sample of my mail.yml;

mail_smtp_server: smtp.mailgun.org
mail_admin: postmaster@acquire.cloudworks.io
mail_hostname: acquire.cloudworks.io
mail_user: postmaster@acquire.cloudworks.io
mail_password: key-redactedredactidredactid

and this has been my Ansible deploy command;

ansible-playbook -i hosts/production server.yml --tags "ssmtp mail"

Any ideas what the issue could be?

retlehs commented 9 years ago

you sure those settings & credentials work for sending email? wordpress falls back to using php's mail() which is configured based off those settings in mail.yml

chrisk2020 commented 9 years ago

Are you using the api key as password - or smtp credentials? https://help.mailgun.com/hc/en-us/articles/203380100-Where-can-I-find-my-API-key-and-SMTP-credentials-

(I am having the same issue)

chrisk2020 commented 9 years ago

After I slept on it - I reprovisioned and for me it worked. I think my issue was that I was deploying to the server, but not reprovisioning.

If it helps here is the functioning mail.yml:

mail_smtp_server: smtp.mailgun.org
mail_admin: postmaster@mg.mydomain.com
mail_hostname: mydomain.com
mail_user: postmaster@mg.mydomain.com
mail_password: mysmtpcredentialpassword
dischord01 commented 9 years ago

I was using the Mailgun API key not SMTP password. I changed it to SMTP password and it worked. Thanks!