• 大小: 0.05M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2020-12-26
  • 语言: C#
  • 标签: 邮件  SMTP  

资源简介

C# 调用SMTP发送有附件的邮件,基本功能已实现,测试通过了

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Mail;
using System.Text.Regularexpressions;

namespace SEmailWithAtt
{
    public partial class frmSend : Form
    {
        public frmSend()
        {
            InitializeComponent();
        }
        //对邮件内容进行编码
        private static string base64Encode(string str)
        {
            return Convert.Tobase64String(Encoding.UTF8.GetBytes(str));
        }

        private void AddFile(string strFileMailMessage message)
        {
            //为要发送的邮件创建附件信息
            Attachment myAttachment = new Attachment(strFile System.Net.Mime.MediaT

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\SEmailWithAtt\
     文件         929  2009-02-10 16:04  调用SMTP发送有附件的邮件\SEmailWithAtt.sln
     文件       30720  2009-02-10 16:42  调用SMTP发送有附件的邮件\SEmailWithAtt.suo
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\SEmailWithAtt\bin\
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\SEmailWithAtt\bin\Debug\
     文件       14336  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\bin\Debug\SEmailWithAtt.exe
     文件       26112  2010-08-18 17:51  调用SMTP发送有附件的邮件\SEmailWithAtt\bin\Debug\SEmailWithAtt.pdb
     文件       14328  2009-02-10 16:06  调用SMTP发送有附件的邮件\SEmailWithAtt\bin\Debug\SEmailWithAtt.vshost.exe
     文件        4831  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\frmSend.cs
     文件       12292  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\frmSend.designer.cs
     文件        6016  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\frmSend.resx
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\
     文件         840  2009-02-10 16:06  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\SEmailWithAtt.csproj.FileListAbsolute.txt
     文件         849  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\SEmailWithAtt.csproj.GenerateResource.Cache
     文件       14336  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\SEmailWithAtt.exe
     文件         180  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\SEmailWithAtt.frmSend.resources
     文件       26112  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\SEmailWithAtt.pdb
     文件         180  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\SEmailWithAtt.Properties.Resources.resources
     目录           0  2012-05-02 09:56  调用SMTP发送有附件的邮件\SEmailWithAtt\obj\Debug\TempPE\
     文件         496  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\Program.cs
     目录           0  2013-01-24 11:41  调用SMTP发送有附件的邮件\SEmailWithAtt\Properties\
     文件        1382  2009-02-10 16:04  调用SMTP发送有附件的邮件\SEmailWithAtt\Properties\AssemblyInfo.cs
     文件        2876  2009-02-10 16:04  调用SMTP发送有附件的邮件\SEmailWithAtt\Properties\Resources.Designer.cs
     文件        5612  2009-02-10 16:04  调用SMTP发送有附件的邮件\SEmailWithAtt\Properties\Resources.resx
     文件        1098  2009-02-10 16:04  调用SMTP发送有附件的邮件\SEmailWithAtt\Properties\Settings.Designer.cs
     文件         249  2009-02-10 16:04  调用SMTP发送有附件的邮件\SEmailWithAtt\Properties\Settings.settings
     文件        3782  2009-02-10 16:05  调用SMTP发送有附件的邮件\SEmailWithAtt\SEmailWithAtt.csproj

评论

共有 条评论