All Projects → mafly → Mail

mafly / Mail

Licence: other
基于 Net.Mail 封装的发送邮件工具类。仅需一行代码,发送邮件。支持自定义邮件发出邮箱、发出方名字等。 支持SSL加密发送。 多个接收人、抄送人。支持群发独显。 支持添加附件、多个附件。 目前大部分主流邮箱全支持。

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Mail

Sendria
Sendria (formerly MailTrap) is a SMTP server designed to run in your dev/test environment, that is designed to catch any email you or your application is sending, and display it in a web interface instead of sending to real world.
Stars: ✭ 30 (-65.52%)
Mutual labels:  mail, email, smtp
ESP-Mail-Client
⚡️Arduino Mail Client Library to send, read and get incoming mail notification for ESP32, ESP8266 and SAMD21 devices. The library also supported other Arduino devices using Clients interfaces e.g. WiFiClient, EthernetClient, and GSMClient.
Stars: ✭ 78 (-10.34%)
Mutual labels:  mail, email, smtp
go-simple-mail
Golang package for send email. Support keep alive connection, TLS and SSL. Easy for bulk SMTP.
Stars: ✭ 298 (+242.53%)
Mutual labels:  mail, email, smtp
Ptorx
📩🛡 Email privacy. Anonymously send and receive with alias forwarding.
Stars: ✭ 187 (+114.94%)
Mutual labels:  mail, email, smtp
Mailinabox
Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
Stars: ✭ 10,649 (+12140.23%)
Mutual labels:  mail, email, smtp
Mailer
A lightweight PHP SMTP mail sender
Stars: ✭ 53 (-39.08%)
Mutual labels:  mail, email, smtp
mailx
A lightweight SMTP mail library
Stars: ✭ 17 (-80.46%)
Mutual labels:  mail, email, smtp
Mailmergelib
MailMergeLib is a mail message client library which provides comfortable mail merge capabilities for text, inline images and attachments, as well as good throughput and fault tolerance for sending mail messages.
Stars: ✭ 97 (+11.49%)
Mutual labels:  mail, email, smtp
Free Email Forwarding
The best free email forwarding for custom domains. Visit our website to get started (SMTP server)
Stars: ✭ 2,024 (+2226.44%)
Mutual labels:  mail, email, smtp
Mailu
Insular email distribution - mail server as Docker images
Stars: ✭ 3,151 (+3521.84%)
Mutual labels:  mail, email, smtp
Mail
The Hoa\Mail library.
Stars: ✭ 24 (-72.41%)
Mutual labels:  mail, smtp
Galleon
A badass SMTP mail server built on Node to make your life simpler.
Stars: ✭ 14 (-83.91%)
Mutual labels:  mail, smtp
Smtp-cracker
[NEW] : Simple Mail Transfer Protocol (SMTP) CHECKER - CRACKER Tool V2
Stars: ✭ 67 (-22.99%)
Mutual labels:  mail, smtp
go-mail
📧 A cross platform mail driver for GoLang. Featuring Mailgun, Postal, Postmark, SendGrid, SparkPost & SMTP.
Stars: ✭ 169 (+94.25%)
Mutual labels:  mail, smtp
mail
Actively maintained fork of gomail. The best way to send emails in Go.
Stars: ✭ 376 (+332.18%)
Mutual labels:  email, smtp
Meteor-Mailer
📮 Bulletproof email queue on top of NodeMailer with support of multiple clusters and servers setup
Stars: ✭ 21 (-75.86%)
Mutual labels:  mail, smtp
smtplib-bruteforce
bruteforcing gmail (TLS/SSL)
Stars: ✭ 26 (-70.11%)
Mutual labels:  mail, smtp
wp-smtp
Simple package for handling WordPress SMTP with .env when using the Roots stack.
Stars: ✭ 31 (-64.37%)
Mutual labels:  mail, smtp
skirnir
Skirnir Email Server
Stars: ✭ 31 (-64.37%)
Mutual labels:  mail, smtp
f3-mailer
Fat-Free Sugar Mailer Plugin
Stars: ✭ 18 (-79.31%)
Mutual labels:  mail, smtp

一行代码,发送邮件

====

由于几乎在项目开发中离不开发送邮件功能,所以,我们反感反复造轮子,就基于Net.Mail封装的发送邮件代码。可以用于在.Net项目中发送邮件,只需一行代码,真的是一行。支持多附件、多接收人、多抄送人。

注:欢迎大家使用及提Bug.


特性

  • 支持自定义邮件发出邮箱、发出方名字等。
  • 支持SSL加密发送。
  • 多个接收人、抄送人。
  • 支持群发独显模式(适用于推广、会员群发等)。
  • 支持添加附件、多个附件。
  • 目前大部分主流邮箱全支持。

安装

via NuGet:

1.打开程序包管理器控制台,执行命令:
  Install-Package Mafly.Mail
或:
2.在Project右键,选择“管理NuGet程序包”,在右上角搜索框搜索“Mafly.Mail”。点击安装

via 源代码:

引用如下两个 .dll 文件
  Newtonsoft.Json.dll
  Mafly.Mail.dll
然后在项目目录下建立一个名字为 Config 文件夹,放入 MailSetting.config 文件,根据自己的邮箱服务器进行配置

注:以上两种方式完成后,都要把MailSetting.config复制到输出目录设置为始终复制,或者把生成操作设置为嵌入的资源。 这一步不能少!不能少!!不能少!!!

用法

          var mailService = new Mafly.Mail.Mail();

          //参数:接收者邮箱、内容
          mailService.Send("[email protected]", "测试邮件发送!");
		  
		  //群发单显参数:多接收者邮箱、内容
          mailService.Send("[email protected],[email protected]", "测试【群发单显】邮件发送!", true);

          //参数:接收者邮箱、接收者名字、内容
          mailService.Send("[email protected]", "mafly", "测试邮件发送!");

          //参数:接收者邮箱、接收者名字、邮件主题、内容
          mailService.Send("[email protected]", "mafly", "邮件发送", "测试邮件发送!");

          //使用MailInfo对象模式  参数:接收者邮箱、接收者名字、邮件主题、内容
          mailService.Send(new MailInfo
          {
              Receiver = "[email protected]",
              ReceiverName = "mafly",
              Subject = "邮件发送",
              Body = "测试邮件发送!"
          });

          //使用MailInfo对象模式  参数:接收者邮箱、接收者名字、邮件主题、内容、附件路径
          mailService.Send(
              new MailInfo
              {
                   Receiver = "[email protected]",
                  ReceiverName = "mafly",
                  Subject = "带附件邮件发送",
                   Body = "测试带附件邮件发送!"
              }, "../../Program.cs");

          //使用MailInfo对象模式  参数:接收者邮箱、接收者名字、邮件主题、内容、多附件路径
          mailService.Send(
              new MailInfo
              {
                Receiver = "[email protected]",
                  ReceiverName = "mafly",
                  Subject = "带附件邮件发送",
                  Body = "测试带附件邮件发送!"
              }, new Attachment("../../Program.cs"), new Attachment("../../App.config"));

API

方法 <void> Send(参数...)

该项目对外只有一个Send(...)公开方法,但该方法包含6个重载。几乎可以满足您的全部日常开发需求!

参数 <sting> receiver

接收人邮箱地址,支持多个email地址。 如需多个接收人请用英文逗号,进行分隔。

参数 <string> receiverName

接收人名字,可不填写,默认为null。

参数 <string> body

邮件内容。可以是纯文本,也可以包含 html 代码。

参数 <sting> subject

邮件主题,可不填写,默认为取邮件内容的前15个字符。

参数 <string> filePath

附件路径。发送带附件的邮件时,请填写要发送附件相对于程序运行目录的路径。

参数 <object> MailInfo

邮件信息对象。其中包含以下属性:

  • Receiver 接收者邮箱(多个用英文“,”号分割)
  • ReceiverName 接收者名字
  • Subject 邮件的主题
  • Body 正文内容
  • CC 抄送人集合(多个用英文“,”号分割)
  • Replay 回复地址

参数 <object> Attachment

附件对象。支持多个!具体请点击官方文档:Attachment Class

参数 <object> MailMessage

邮件信息对象。具体请点击官方文档:MailMessage Class

Q&A

你封装的这一个其实并没有什么卵用,很简单阿,有这个必要吗?

是的,你说的对。

为什么不使用现成的那些、在线服务呢?如:SendCloud

你管。

真的是一行代码么?我看到好多行阿。

现在这个社会,没有噱头谁会看呢,您说是吧?

我能再问最后一个问题吗?

不能。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].