Skip to content

Commit 893c205

Browse files
authored
Merge pull request #346 from mguinness/patch-1
Document Aspire integration
2 parents 0ad6265 + a671572 commit 893c205

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@ Access at: **http://localhost:37408** | Send emails to: **localhost:2525**
6464

6565
> **Note:** Docker uses non-privileged ports by default (SMTP: 2525, HTTP: 8080). See the [Service README](src/Papercut.Service/Readme.md#option-3-run-in-docker) for configuration options, Docker Compose examples, and troubleshooting.
6666
67+
### Aspire Integration
68+
69+
Papercut SMTP can be used for local email testing with Aspire projects. The integration exposes a connection string with the format `endpoint=smtp://<host>:<port>` which can be used to configure the SMTP client.
70+
71+
#### Setup
72+
73+
Install the package `CommunityToolkit.Aspire.Hosting.PapercutSmtp` from NuGet and then configure the integration in your App Host as follows:
74+
75+
```c#
76+
var builder = DistributedApplication.CreateBuilder(args);
77+
78+
var papercut = builder.AddPapercutSmtp("papercut");
79+
80+
builder.AddProject<Projects.ExampleProject>()
81+
.WithReference(papercut)
82+
.WaitFor(papercut);
83+
```
84+
85+
After running, the ports for both the Papercut UI and the SMTP service are automatically assigned and accessible through the Aspire dashboard.
86+
6787
## SMTP Authentication and TLS/STARTTLS Support
6888

6989
Papercut SMTP Server supports optional SMTP authentication and TLS/STARTTLS encryption for secure email testing.

0 commit comments

Comments
 (0)