邮件发送组件

1.在参考中右键单击添加服务参考,输入地址,修改命名空间为MW_eMail
2.加入下面这段话(记得修改命名空间,其他为固定格式)

     public static MW_eMail.OraServiceClient OraDataLink = new MW_eMail.OraServiceClient();
     private void setServiceClient()
    {
        System.ServiceModel.BasicHttpBinding binding = new System.ServiceModel.BasicHttpBinding();
        binding.SendTimeout = new TimeSpan(0, 0, 15, 0, 0);
        binding.OpenTimeout = new TimeSpan(0, 0, 15, 0, 0);
        binding.ReceiveTimeout = new TimeSpan(0, 0, 15, 0, 0);
        binding.CloseTimeout = new TimeSpan(0, 0, 15, 0, 0);
        binding.TransferMode = System.ServiceModel.TransferMode.Streamed;
        binding.MaxReceivedMessageSize = 2147483647;
        binding.MaxBufferSize = 2147483647;
        binding.MaxBufferPoolSize = 2147483647;
        binding.ReaderQuotas.MaxStringContentLength = 2147483647;
        binding.ReaderQuotas.MaxDepth = 2147483647;
        binding.ReaderQuotas.MaxArrayLength = 2147483647;
        binding.ReaderQuotas.MaxBytesPerRead = 2147483647;
        binding.ReaderQuotas.MaxNameTableCharCount = 2147483647;
        var endpoint = new EndpointAddress("http://cae/CAEServices/CAEService.svc");
        OraDataLink = new MW_eMail.OraServiceClient(binding, endpoint);
    }

3.加入下列code

  //在按键里加入下列命令:"cae520(密码固定不变)","内容(
是回车)","主题Stone_Test","发件者 [email protected]","收件者(用;隔开)","副本","附件(为空就好)","严重程度(High,normald等等)","显示的小标题" OraDataLink.SendMail("cae520", "Moria_Test






BSR", "Stone_Test", "[email protected]", "[email protected]", "[email protected]", "", "High", "CAE ASUS");
winform中加入邮件发送组件:
邮件发送组件_第1张图片
9.jpg
10.jpg

你可能感兴趣的:(邮件发送组件)