Skip to content

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

@vbmark

Description

@vbmark

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 [email protected]

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('[email protected]', '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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions