admin管理员组

文章数量:1122832

I have developed an app, which is connected to my WordPress Backend. I would like to provide my User (WP User) an email function to send and receive mails without using a dedicated email account (through http request in the app). WP User should send out an email via my WP Backend and getting emails via the same backend. Email address should be a random generated one.

What would be the best way to achieve this, is it possible to use my WP Backend like a mailserver. I do not expect a heavy email traffic for my planned usage. Maybe there is already existing plugins which I do not covered. I am happy about every feedback.

I have developed an app, which is connected to my WordPress Backend. I would like to provide my User (WP User) an email function to send and receive mails without using a dedicated email account (through http request in the app). WP User should send out an email via my WP Backend and getting emails via the same backend. Email address should be a random generated one.

What would be the best way to achieve this, is it possible to use my WP Backend like a mailserver. I do not expect a heavy email traffic for my planned usage. Maybe there is already existing plugins which I do not covered. I am happy about every feedback.

Share Improve this question asked May 10, 2024 at 9:11 devreklimdevreklim 31 bronze badge 4
  • Here's an old question about receiving email. There wasn't a solution. – Rup Commented May 10, 2024 at 10:45
  • You probably either want to 1) set up a separate mailserver service, and use WordPress to read and write emails through it using IMAP; 2) find an existing online mail sender service that supports receiving emails too, e.g. using a management API to set up the random addresses for receive, and integrate with that. (It's also possible your host won't let you run your own mail server, or at least that was a common policy a while ago because customer-run servers were an attack vector and got exploited.) – Rup Commented May 10, 2024 at 10:47
  • I was expecting that this is a common request from users of wordpress. So am I right, that this has to be developed then individually with an external mailing service? – devreklim Commented May 10, 2024 at 10:57
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Bot Commented May 13, 2024 at 17:36
Add a comment  | 

1 Answer 1

Reset to default 0

Sending mails from WordPress is pretty straightforward, using wp_mail. The tricky bit is receiving mail. You could probably achieve this by hijacking the method that WordPress has to post by mail. In that code you see this line:

do_action( 'wp-mail.php' );

This allows you to take over the posting process. So, in stead of posting the content of an email you could do something else with it, for instance store it in a table that is attached to a user's profile.

Making this happen is likely a lot of work. Going with @Rup's suggestion to use an external server is probably a better idea.

本文标签: wp mailSend and receive emails with wpmail() for WP User (like Mailserver)