Skip to content

jmcarrasc0/Cryptography

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jmcarrasco logo

Mail.Sending is a nuget package based on .NET for sending mail through an Smtp server with the SMTP Relay function or with user and password authentication..

Quick install

Mail.Sending is constantly in development! Try it out now:

NuGet

PM> Install-Package Jmcarrasc0.Mail.Sending -Version 1.1.1

or

.NET CLI

> dotnet add package Jmcarrasc0.Mail.Sending --version 1.1.1

PackageReference

<PackageReference Include="Jmcarrasc0.Mail.Sending" Version="1.1.1" />

Paket CLI

> paket add Jmcarrasc0.Mail.Sending --version 1.1.1

Script & Interactive

> #r "nuget: Jmcarrasc0.Mail.Sending, 1.1.1"

Cake

// Install Jmcarrasc0.Mail.Sending as a Cake Addin
#addin nuget:?package=Jmcarrasc0.Mail.Sending&version=1.1.1

// Install Jmcarrasc0.Mail.Sending as a Cake Tool
#tool nuget:?package=Jmcarrasc0.Mail.Sending&version=1.1.1


How to use it

It is very easy to implement

C#

using Jmcarrasc0.Mail.Sending;

var mail = new Mail();

    var email = new Email()
    {
        Account = "Account or user",
        Password = "Password",
        MailServer = "Server",
        IsSSL = "true or false",
        Port = "Default communication port 25",
        Addressees = new List<Addressee>() {
            new Addressee {
                ShowName = "ShowName",
                Mail = "correo@demo.com",
            }
        },
        AddresseesCC = new List<Addressee>() {
            new Addressee {
                ShowName = "ShowName",
                Mail = "correo@demo.com",
            }
        },
        AddresseesBCC = new List<Addressee>() {
            new Addressee {
                ShowName = "ShowName",
                Mail = "correo@demo.com",
            }
        },
        BodyIsHtml = "true or false",
        Body = "Read your HTML structure",
        ScreenName = "Name to Display",
        Title = "Title",
        Attachments = new List<Attached>() {
            new Attachments {
                file="Binary file",
                name="Name",
                MediaType="Media type" 
            }
        }
        
    };

    _ = mail.SendMail(email);


/// <summary>
/// Function for sending e-mails through SMTP Relay
/// </summary>


var mail = new Mail();

    var email = new EmailHost()
    {
        Host = "Server",
        IsSSL = "true or false",
        From= "From Email",
        Port = "Default communication port 25",
        Addressees = new List<Addressee>() {
            new Addressee {
                ShowName = "ShowName",
                Mail = "correo@demo.com",
            }
        },
        AddresseesCC = new List<Receiver>() {
            new Addressee {
                ShowName = "ShowName",
                Mail = "correo@demo.com",
            }
        },
        AddresseesBCC = new List<Addressee>() {
            new Addressee {
                ShowName = "ShowName",
                Mail = "correo@demo.com",
            }
        },
        BodyIsHtml = "true or false",
        Body = "Read your HTML structure",
        ScreenName = "Name to Display",
        Title = "Title",
        Attachments = new List<Attached>() {
            new Attachments {
                file="Binary file",
                name="Name",
                MediaType="Media type" 
            }
        }
        
    };

   _ = mail.SendMailbyHost(email);



VB.NET

Imports Jmcarrasc0.Mail.Sending

        Dim mail = New Mail()
        Dim email = New Email() With {
            .Account = "Account or user",
            .Password = "Password",
            .MailServer = "Server",
            .IsSSL = "true or false",
            .Port = "Default communication port 25",
            .Recipients = New Recipient List(From Recipients)() From {
                New Recipient() With {
                    .ShowName = "Show Name",
                    .Mail = "correo@demo.com"
                }
            },
            .AddresseesCC = New List(Of Addressee)() From {
                New Addressee() With {
                    .ShowName = "ShowName",
                    .Mail = "correo@demo.com"
                }
            },
            .AddresseesBCC = New List(Of Addressee)() From {
                New Addressee() With {
                    .ShowName = "ShowName",
                    .Mail = "correo@demo.com"
                }
            },
            .BodyIsHtml = "true or false",
            .Body = "Read your HTML structure",
            .ScreenName = "Name to Display",
            .Title = "Title",
            .Attachments = New List(Of Attached)() From {
                New Attachment() With {
                    .file = "Binary File",
                    .name = "Name",
                    .MediaType = "Media Type"
                }
            }
        }
        Dim result = mail.SendMail(email)


'Function for sending e-mails through SMTP Relay'


        Dim mail = New Mail()
        Dim email = New EmailHost() With {
            .Host = "Server",
            .IsSSL = "true or false",
            .Port = "Default communication port 25",
            .Recipients = New Recipient List(From Recipients)() From {
                New Recipient() With {
                    .ShowName = "Show Name",
                    .Mail = "correo@demo.com"
                }
            },
            .AddresseesCC = New List(Of Addressee)() From {
                New Addressee() With {
                    .ShowName = "ShowName",
                    .Mail = "correo@demo.com"
                }
            },
            .AddresseesBCC = New List(Of Addressee)() From {
                New Addressee() With {
                    .ShowName = "ShowName",
                    .Mail = "correo@demo.com"
                }
            },
            .BodyIsHtml = "true or false",
            .Body = "Read your HTML structure",
            .ScreenName = "Name to Display",
            .Title = "Title",
            .Attachments = New List(Of Attached)() From {
                New Attachment() With {
                    .file = "Binary File",
                    .name = "Name",
                    .MediaType = "Media Type"
                }
            }
        }
        Dim result = mail.SendMailbyHost(email)
        


Compatibily Support

Mail.Sending is a nuget package compatible with the following Frameworks

  • .NET 6
  • .NET 5
  • .NET Core 3.1


Copyright and license Github

Code copyright 2022 Juan Carrasco. Code released under the MIT license.

About

Jmcarrasc0 - Services

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages