https://github.com/scottlilly/fluentemail
NuGet package adding fluent interface to write code for emails
https://github.com/scottlilly/fluentemail
c-sharp email fluent-interface nuget-package
Last synced: about 1 month ago
JSON representation
NuGet package adding fluent interface to write code for emails
- Host: GitHub
- URL: https://github.com/scottlilly/fluentemail
- Owner: ScottLilly
- License: mit
- Created: 2022-07-04T16:40:00.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2025-05-17T20:09:48.000Z (about 1 year ago)
- Last Synced: 2025-08-01T02:06:52.704Z (10 months ago)
- Topics: c-sharp, email, fluent-interface, nuget-package
- Language: C#
- Homepage:
- Size: 55.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ScottLilly.FluentEmail (NuGet package)
This is a fluent interface NuGet package to help build MailMessage objects.
Designed to make email sending code easier to use and more natural sounding when reading the source code.
## Project Overview

[](https://www.nuget.org/packages/ScottLilly.FluentEmail/)
[](https://www.nuget.org/packages/ScottLilly.FluentEmail/)
[](https://github.com/ScottLilly/FluentEmail/LICENSE)
## Instructions
Instructions are available at: https://github.com/ScottLilly/FluentEmail/blob/master/INSTRUCTIONS.md
This package lets you use IntelliSense and method chaining to create a MailMessage object, and enforces "rules of grammar" to ensure the required values are set.
For example, after calling CreateMailMessage() or CreateHtmlMailMessage(), the only function available next (shown via IntelliSense) is the From() function. The From() function cannot be called more than once. After it's called, the library requires you call To() at least once. And so on.
**Sample code using FluentEmail**
```
MailMessage mailMessage =
FluentMailMessage
.CreateMailMessage()
.From("from@test.com")
.To("qwe@test.com", "Qwe Test")
.To(new MailMessage("jhg@test.com", "Jhg Test"))
.CC("lkj@test.com")
.CC("yui@test.com")
.Subject("Hello")
.Body("Please review the attached image")
.AddAttachment(@"D:\Images\Logo.png", "image/png")
.Build();
```
## Requirements
- .NET Standard 2.0+
## Contributing
Contributions are welcome. Please submit issues or pull requests to the GitHub repository at: https://github.com/ScottLilly/FluentEmail/issues
## License
This project is licensed under the MIT License. See the [LICENSE file](https://github.com/ScottLilly/FluentEmail/blob/master/LICENSE.md) for details.
## Contact
For questions or feedback, please [open an issue here on GitHub](https://github.com/ScottLilly/FluentEmail/issues).