����λ�ã���ҳ > �����̳� > �̳� > ����.NET��Դ�����ʼ��������Ƽ�

����.NET��Դ�����ʼ��������Ƽ�

��Դ������������|��ʱ�䣺2024-08-06 10:21:48 |���Ķ���102��|�� ��ǩ�� T Net ��Դ �ʼ� �����ʼ� �� |����������

ǰ�� ���ճ����������У������ʼ�������һ�����ɻ�ȱ�Ĺ��ܣ��������û�ע����֤��֪ͨ���ͻ����ճ���ҵ��ͨ�����벻�������ʼ���֧�֡������Ҧ����ҷ���2��.NET��Դ����Ч��ǿ���.NET�����ʼ������⣬��Щ�ⲻ�����˵����ʼ��ķ��͡����պ͹������������ṩ�˷ḻ�Ĺ��ܺ���������ѡ���������ָ���

���ճ������������У������ʼ��������������Dz��ɻ�ȱ�ġ������������û�ע����֤��֪ͨ���ͣ������ճ���ҵ��ͨ�����벻���Ե����ʼ����������ڽ���ķ����У��������Ƽ�����.NET��Դ����Ч��ǿ��ĵ����ʼ������⡣��Щ�ⲻ�����˵����ʼ��ķ��͡����պ͹������������ṩ�˷ḻ�Ĺ��ܺ���������ѡ���������ָ��ӵ�ҵ������

MailKit

��һ���Ƽ�����MailKit��MailKit��һ����ƽ̨�Ŀ�Դ��MIT License������ѵ�.NET�ʼ������⣬�ṩǿ���API�����ڷ��͡����պʹ��������ʼ������⣬�����ṩ�˶�SMTP��POP3��IMAPЭ���ȫ��֧�֡�

���͵����ʼ��򵥲�����


using System;
using MailKit.Net.Smtp;
using MailKit;
using MimeKit;

namespace TestClient {
    class Program {
        public static void Main (string[] args) {
            var message = new MimeMessage ();
            message.From.Add (new MailboxAddress ("Joey Tribbiani", "[email protected]"));
            message.To.Add (new MailboxAddress ("Mrs. Chanandler Bong", "[email protected]"));
            message.Subject = "How you doin'?";

            message.Body = new TextPart ("plain") {
                Text = @"Hey Chandler,

I just wanted to let you know that Monica and I were going to go play some paintball, you in?

-- Joey"
            };

            using (var client = new SmtpClient ()) {
                client.Connect ("smtp.friends.com", 587, false);

                // Note: only needed if the SMTP server requires authentication
                client.Authenticate ("joey", "password");

                client.Send (message);
                client.Disconnect (true);
            }
        }
    }
}

FluentEmail

�ڶ����Ƽ�����FluentEmail��FluentEmail��һ������.NET��.NET Core�ĵ����ʼ����Ϳ⣬�ṩ�˼����õ�API�����͵����ʼ�������Ŀ֧��ʹ��Razorģ�������������ʼ����ݣ�������ͨ��SendGrid��MailGun��SMTP�ȶ��ַ�ʽ���з��͡�

���͵����ʼ��򵥲�����


var email = await Email
.From("[email protected]")
.To("[email protected]", "bob")
.Subject("hows it going bob")
.Body("yo bob, long time no see!")
.SendAsync();

// Using Razor templating package (or set using AddRazorRenderer in services)
Email.DefaultRenderer = new RazorRenderer();

var template = "Dear @Model.Name, You are totally @Model.Compliment.";

var email = Email
.From("[email protected]")
.To("[email protected]")
.Subject("woo nuget")
.UsingTemplate(template, new { Name = "Luke", Compliment = "Awesome" });

������Ŀ�Ϳ�ܾ�ѡ

������Ŀ������¼��C#/.NET/.NET Core������Ŀ�Ϳ�ܾ�ѡ�С���ע������Ŀ�Ϳ�ܾ�ѡ�����㼰ʱ�˽�C#��.NET��.NET Core��������¶�̬�����ʵ������߿�������Ч�ʺ���������ӭ���ӻԾ�ύPR�Ƽ����Լ������������Ŀ�Ϳ�ܲ�����û��

С���Ƽ��Ķ�

�������������Ľ�Ϊ������Ϣ����������������ͬ���޹۵��֤ʵ��������

�����Ƶ����

����

ͬ������

����

ɨ��ά�����������ֻ��汾��

ɨ��ά����������΢�Ź��ںţ�

��վ�������������������ϴ��������ַ���İ�Ȩ���뷢�ʼ�[email protected]

��ICP��2022002427��-10 �湫��������43070202000427��© 2013~2025 haote.com ������