mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #251] Sending mails with HTTP API #163
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @shyim on GitHub (Feb 24, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/251
It would be nice if we could send also mails to mailpit using HTTP requests. Maybe the API should be like:
(there is no standard 😭 )
For my use-case I don't need something really specific, as I could adopt it, but for people outside it makes sense to use a existing API format to kinda just exchange the endpoint to mailpit and it works.
I am not sure if this is 100% the scope of Mailpit as an simple HTTP to smtp application before can do it kinda too 😅.
@axllent commented on GitHub (Feb 24, 2024):
This has been discussed a couple of times in previous GitHub issues ) search aes or mailgun) - basically requests to mimic the functionality (reverse engineer) that some of these protocols (which I will not do as it will be a lot of work to maintain). As you said, there is no standard, so it's a moving target. For these I suggested they build a "bridge' with an API and then that bridge can push the messages over SMTP to Mailpit, but I don't think any of them were keen to do the work themselves 😅
But your request seems a bit different, not specific to any specific one, just to be able to ingest messages over http. I would like to know why exactly? What would be the reason you want/need to integrate with yet another http API rather than to use the most common one in the world, SMTP?
@shyim commented on GitHub (Feb 24, 2024):
I am using https://workers.cloudflare.com for my application, so I am sticking to HTTP. When running the app locally with their "emulator", I would like to send the mails to a local mailpit instance. Right now I am console.log the mail, when in dev mode 😅 . See example of the app, maybe helps more to understand https://github.com/FriendsOfShopware/shopmon/blob/main/api/src/mail/mail.ts#L16
So any kind of API would help me here :)
@axllent commented on GitHub (Feb 24, 2024):
I see where this is going, or to be more specific, where it will end up going (through no fault of your own).... Let's say I created a basic http end point to send mail, eg: some basic to, from, cc, subject, body fields etc - then the next user wants to add attachments, the next to insert custom headers, the next to support DKIM signatures etc etc. Before long, I Mailpit has its own complete custom implementation of one of those services you listed earlier 😂
Whilst the idea might sound good, there is no standard between these, so we're back to the start (the original requests for compatibility with each of these various services. Yes a great idea, but a lot of ongoing work... Especially when those services bring out new features.
I have another idea which I think you could (and probably should) do - why not just send your email directly to Mailpit via SMTP from JavaScript? I saw there is a library which does just that. I'm on my phone so I haven't looked too much into it, but from what I can see it should do exactly what want?
@shyim commented on GitHub (Feb 24, 2024):
Ahh, yea had kinda the same feeling. I will look for another solution :).
Thanks you for maintaining mailpit!