Git Product home page Git Product logo

smtp-winrt's Introduction

SMTP client for Windows Store

An SMTP client for Windows Store apps (WinRT and UWP). Send emails from within your Windows Universal App.

Installation

You can download and build this project or simply install it via NuGet:

PM> Install-Package lightbuzz-smtp

This requires the 'internetClient' Capability to be enabled in the Package.appxmanifest of the universal app.

Examples

Import the assembly to your project and include its namespace:

using LightBuzz.SMTP;

Send an email message

This is an example of using your own SMTP server. Check below for using Gmail and Outlook.

using (SmtpClient client = new SmtpClient("smtp.example.com", 465, false, "[email protected]", "Pa$$w0rd"))
{
        EmailMessage emailMessage = new EmailMessage();

        emailMessage.To.Add(new EmailRecipient("[email protected]"));
        emailMessage.CC.Add(new EmailRecipient("[email protected]"));
        emailMessage.Bcc.Add(new EmailRecipient("[email protected]"));
        emailMessage.Subject = "Subject line of your message";
        emailMessage.Body = "This is an email sent from a WinRT app!";
        
        await client.SendMailAsync(emailMessage);
}

Credentials for Gmail

Server: smtp.gmail.com
Port: 465
SSL: True

Important Note for Gmail

Since this does not use OAUTH2, Gmail considers this a "less secure app". To use this with Gmail, the "Access for less secure apps" setting on the account will have to be changed to "Enable".

Credentials for Outlook

Server: smtp-mail.outlook.com
Port: 587
SSL: False (upgarde SSL after STARTTLS)

Contributors

Blog post

Read the detailed post by Sebastien here.

License

You are free to use these libraries in personal and commercial projects by attributing the original creator of the project. View full License.

smtp-winrt's People

Contributors

vangos avatar primalzed avatar alessandrobo avatar vatsalyagoel avatar jochenkalmbach avatar mellir avatar

Watchers

L3DLP avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.