https://github.com/mattumotu/postman
a light weight, object-oriented .Net SDK for sending emails
https://github.com/mattumotu/postman
csharp dotnet email
Last synced: about 1 year ago
JSON representation
a light weight, object-oriented .Net SDK for sending emails
- Host: GitHub
- URL: https://github.com/mattumotu/postman
- Owner: mattumotu
- License: bsd-3-clause
- Created: 2017-09-07T14:43:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-02T17:37:11.000Z (about 7 years ago)
- Last Synced: 2025-03-20T16:16:31.254Z (over 1 year ago)
- Topics: csharp, dotnet, email
- Language: C#
- Homepage:
- Size: 308 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postman

Postman is a C#.Net implementation of the wonderful [jcabi-email](https://github.com/jcabi/jcabi-email) created by [Yegor Bugayenko](https://github.com/yegor256)
More details are here: [email.jcabi.com](http://email.jcabi.com/).
[](https://ci.appveyor.com/project/mattumotu/postman)
[](https://coveralls.io/github/mattumotu/postman?branch=master)
[](https://sonarcloud.io/dashboard?id=postman)
[](https://www.nuget.org/packages/Postman/)
Installation
---
Via NuGet
PM> Install-Package Postman
Usage
-----
This example shows basic C# use of Postman
```cs
using System.Collections.Generic;
using Postman
using Postman.Interfaces
// Create Stamps
ICollection stamps = new List();
stamps.Add(new Stamp.Recipient("test@test.com; test1@test.com"));
stamps.Add(new Stamp.Subject("This is a test email"));
stamps.Add(new Stamp.Sender("test@test.com", "test account"));
// Create Enclosures
ICollection enclosures = new List();
enclosures.Add(new Enclosure.Plain("plain text"));
// Create Envelope
IEnvelope exampleEnv = new Envelope(stamps, enclosures);
// Create Postman
IPostman postman = new Postman("my.smtp.host");
// Send Envelope
postman.Send(exampleEnv);
```
This example shows basic VB.net use of Postman
```vbnet
Imports System.Collections.Generic
Imports Postman
Imports Postman.Interfaces
' Create Stamps
Dim stamps As ICollection(Of IStamp) = New List(Of IStamp)()
stamps.Add(New Stamp.Recipient("test@test.com; test1@test.com"))
stamps.Add(New Stamp.Subject("This is a test email"))
stamps.Add(New Stamp.Sender("test@test.com", "test account"))
' Create Enclosures
Dim enclosures As ICollection(Of IEnclosure) = New List(Of IEnclosure)()
enclosures.Add(New Enclosure.Plain("plain text"))
Dim embResList As New List(Of IEmbeddedResource)
embResList.Add(New EmbeddedResource.EmbeddedResource(
HttpContext.Current.Server.MapPath("~/Images/ExmapleImage.jpg"),
New Net.Mime.ContentType(Net.Mime.MediaTypeNames.Image.Jpeg),
"APHALogo"))
encs.Add(New Enclosure.Html("My HTML Text
", embResList))
' Create Envelope
Dim exampleEnv As IEnvelope = New Envelope(stamps, enclosures)
' Create Postman
Dim postman As IPostman = New Postman("my.smtp.host")
' Send Envelope
postman.Send(exampleEnv)
```