Coder Social home page Coder Social logo

cake-contrib / cake.email Goto Github PK

View Code? Open in Web Editor NEW
2.0 5.0 10.0 2.17 MB

Cake Addin that exends Cake with ability to send email.

Home Page: https://cake-contrib.github.io/Cake.Email/docs/

C# 96.59% PowerShell 2.83% Shell 0.58%
cake-build cake-addin

cake.email's Introduction

Cake.Email

License

Cake.Email is an Addin for Cake which allows sending of email from your build scripts.

Usage

First, include a reference to this addin in your script like this:

#addin nuget:?package=Cake.Email&version=0.8.0&loaddependencies=true

Second, we highly recommend that you add the following 'using' statement in your script. Technically, this is not necessary, but it simplifies dealing with attachements:

using Cake.Email.Common;

Also, this addin is designed to take advantage of some of the new features released in CakeBuild version 0.33.0 therefore your tools\package.config should look like this:

<packages>
    <package id="Cake" version="0.33.0" />
</packages>

Information

Stable Pre-release
GitHub Release - GitHub release
Package NuGet MyGet

Build Status

Develop Master
Build status Build status

Code Coverage

Coverage Status

Quick Links

Chat Room

Please do not hesitate to reach out in the GitHub discussions if you have any issues using this addin.

cake.email's People

Contributors

agc93 avatar augustoproiete avatar devlead avatar gep13 avatar jericho avatar jokay avatar mhoopertr avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cake.email's Issues

Send multi-part emails

Currently we send either html or text content. It would be great to send both (just like SendGrid, CakeMail and all other ESPs).

Recommended changes resulting from automated audit

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.26.1. Please upgrade to 0.28.0

Apologies if this is already being worked on, or if there are existing open issues, this issue was created based on what is currently published for this package on NuGet.org and in the project on github.

Switch away from System.Net.Mail

System.Net.Mail is not available in netstandard1.6 therefore we need an alternative in order to ensure we can multi-target net46 and netstandard1.6

MailKit is an excellent alternative

Upgrade to Cake 0.26.0 and target netstandard2.0

We performed an automated audit of your Cake addin and found that it does not follow all the best practices.

We encourage you to make the following modifications:

  • You are currently referencing Cake.Core 0.22.2. Please upgrade to 0.26.0
  • You are currently referencing Cake.Common 0.22.2. Please upgrade to 0.26.0
  • Your addin should target netstandard2.0
    (Please note: there is no need to multi-target. As of Cake 0.26.0, netstandard2.0 is sufficient)

Replace Gitter with GitHub Discussions

The Discussion platform for Cake-Contrib has been moved from Gitter to GitHub Discussion (see cake-build/website#1470).
Please check this repo for references to Gitte and replace them accordingly.

Search suggests that references could be in

  • README.md
  • docs/input/blog/new-release-0.3.0.md
  • docs/input/blog/new-release-0.4.0.md
  • docs/input/blog/new-release-0.5.0.md
  • docs/input/blog/new-release-0.2.0.md
  • docs/input/blog/new-release-0.7.0.md
  • docs/input/blog/new-release-0.8.0.md
  • docs/input/blog/new-release-0.6.0.md
  • docs/input/blog/new-release-0.5.4.md

Doesn't allow to send mail with empty password

Doesn't work if the SMTP password is blank. I tested the same thing with using native .NET SmtpClient and not passing the password, that is how the credentials are setup, was able to send mail

mailClient.EnableSsl = false;
mailClient.Host = "<my smtp server>";
mailClient.Port = 25;
mailClient.Credentials = new NetworkCredential("<my username>", string.Empty);

MimeTypesMap is not included in the NuGet package

Currently, MimeTypesMap is not included in the NuGet package for Cake.Email. This results in a file not found assembly loading failure when running.

This would need any of:

  • Including MimeTypesMap in the Nuget package (assuming Recipe can do this @gep13 ?)
  • Try ILMerge/ILRepack'ing MimeTypesMap.dll into Cake.Email.dll
  • Update documentation to include #nuget:?package=MimeTypesMap (wrong TFM)

Failed to send email

Hello. I am trying to use latest version of Cake.Email.0.8.0 but cannot send email via code like this :

var result = Email.SendEmail(
	senderName: "Deployment Agent",
	subject: "Report Deploy " + DateTime.Now.ToString("yyyy-MM-dd-HH:mm"),		
	senderAddress: "****@***",
	recipients: recipientsAresses,
	htmlContent: "<html><body>" + message + "</body></html>",
	textContent: message,
	attachments: null,
	settings: new EmailSettings 
	{
		SmtpHost = "****",
		Port = 587, 
		EnableSsl = true,
		Username = "****",
		Password = "****"
	});
	if (result.Ok)
	{
		Information("Email succcessfully sent");
	}
	else
	{
		Error("Failed to send email: {0}", result.Error);
	}

Error I had always got :
Failed to send email: The handshake failed due to an unexpected packet format.
I don't understand - problem in my code, either on recipient server side, or my own server.

I also tried to use telnet to sending email, and it was success :

Telnet
Set localecho
Set logfile
open **** 587
HELO *****
mail from :****@*****
rcpt to: ******
Data
Subject: Test

test message

.
Quit

Attach files option not availble in cake mail addin

I am using Cake.Email addin for sending mail to multiple recipents but i need to attach some documents while sending mail.
I think we don't have this feature .So please add this option in Cake.Email addin .It will be very useful too

Given path format not supported

We could not use path format like below in LocalFile method

var attachments = new[]
{
    Email.CreateAttachmentFromLocalFile("â€ĒD:\\error.zip")
};

Error: The given path's format is not supported.

Tried like below

Email.CreateAttachmentFromLocalFile("â€Ē./error.zip")

but shows

Error :Unble to locate local file

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.