Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Provide some steps on how to send emails via php or wp_mail for testing. #291

Open
vbmark opened this issue Oct 1, 2024 · 0 comments
Assignees

Comments

@vbmark
Copy link

vbmark commented Oct 1, 2024

About which PHP Version we are talking ?
PHP83

Is your feature request related to a problem? Please describe.
I don't think so.

Describe the solution you'd like
Some information with steps on how to send emails via php or wp_mail for testing.

Describe alternatives you've considered
I tested with MailHog in its own docker image and alternatively adding it to docker-compose-lamp's docker-compose.yml file. For example, I added:

mailhog:
   container_name: "${COMPOSE_PROJECT_NAME}-mailhog"
   image: mailhog/mailhog
   ports:
     - "8025:8025"
     - "1025:1025"
   environment:
     MH_STORAGE: maildir
     MH_MAILDIR_PATH: /tmp
   volumes:
     - "./docker/data/mail/tmp/mailhog:/tmp"

On my host OS (Debian) when I do the following at the command line:
echo "My message" | mail -s subject test@example.com

The message appears in MailHog at:
http://localhost:8025/#

In my WordPress application in the php83 Container, I am sending a test email like this:
wp_mail('test@example.com', 'Test Email', 'This is a test email from WordPress');

The message does not appear in MailHog.

I have the following in php.ini and confirmed the existence of mhsendmail:
sendmail_path = /home/me/go/bin/mhsendmail --smtp-addr mailhog:1025

And have the following in wp-config.php:

define('SMTP_HOST', 'mailhog');
define('SMTP_PORT', '1025');

I don't know what else to try so am hoping for further information on what I might be missing.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants