在Share Point中发送电子邮件时出错 [英] Getting error while sending email in Share Point

查看:124
本文介绍了在Share Point中发送电子邮件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,





我在通过事件接收方发送电子邮件时遇到错误的分享点,你能引导我或者发送片段。





intilally我尝试使用以下代码



SmtpClient mailClient = new SmtpClient(smtp.gmail.com,587);



以及我在下面尝试的单词之后



SmtpClient mailClient = new SmtpClient(smtp.gmail.com,25);





请求获得许可类型为'System.Net.Mail.SmtpPermission,System,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'失败。

Hi All,


I am getting below error in share point while sending email through event receiver, can you guide me or send snippets.


intilally i tried with below code

SmtpClient mailClient = new SmtpClient("smtp.gmail.com", 587);

and after words i tried with below

SmtpClient mailClient = new SmtpClient("smtp.gmail.com", 25);


Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

推荐答案

这似乎是web.config中的权限/信任级别设置问题。请参阅在我上传的文件中在Asp.net中发送电子邮件时出错 [ ^ ]获取更多信息。



作为替代方案,您可以使用方法
This appears to be a permission / trust level setting issue in the web.config. See Error On sending Email in Asp.net on My uploaded File[^] for some more info.

As an alternative, You can use the E-Mail sharepoint is confiugred to use by using the method
SPUtility.SendEmail

使用电子邮件共享点来使用SPUtility.SendEmail方法 - https://msdn.microsoft.com/en- us / library / microsoft.sharepoint.utilities.sputility.sendemail(v = office.12).aspx [ ^ ]



此方法允许您使用Conf的电子邮件服务器在SharePoint(用于警报和通知的电子邮件)中配置管理中心。

SPUtility.SendEmail Method - https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.sendemail(v=office.12).aspx[^]

This method allows you to use the email server that is Configured in SharePoint (the same email used for alerts and notificaitons) Central Administration.


这篇关于在Share Point中发送电子邮件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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