System.Net.Mail与Microsoft.SharePoint.Client.Utilities [英] System.Net.Mail vs Microsoft.SharePoint.Client.Utilities

查看:53
本文介绍了System.Net.Mail与Microsoft.SharePoint.Client.Utilities的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All,

Hello All,

我可以使用CSOM   Microsoft.SharePoint.Client.Utilities发送电子邮件。但是,由于防火墙,我在使用System.Net.Mail发送电子邮件时遇到了问题。

I can able to send email with CSOM  Microsoft.SharePoint.Client.Utilities. However, I have issues while using System.Net.Mail to send an email because of firewall.

有人可以解释一下吗?

知识就是力量。信息就是财富。

Knowledge is power.Information is wealth.

推荐答案

System.Net.Mail将访问远程SMTP服务器,如果FireWall阻止网络或端口,则会引发错误:

System.Net.Mail will access the Remote SMTP Server and if FireWall block the Network or Port, then it will raise error:

通过.NET框架发送电子邮件,以及一般问题 - 使用C#代码

对于SharePoint环境,我们通常使用SharePoint.Client.Utilities.SendMail,此API不需要访问远程邮件服务器而不是System.Net.Mail ,它将使用SharePoint Email Exchange Server发送邮件,我们只需要提供
的邮件数据即可发送。 

And for SharePoint environment, we usually use SharePoint.Client.Utilities.SendMail, this API not need to access the Remote Mail Server rather than System.Net.Mail, it will use the SharePoint Email Exchange Server to send the mail, we only need to provide the mail data for sending. 

谢谢

最好的问候


这篇关于System.Net.Mail与Microsoft.SharePoint.Client.Utilities的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆