English 中文(简体)
Cannot 发出 电子邮件在2010年海关工作流程中的份额
原标题:Cannot send Email in custom workflow sharepoint 2010

我在使用SPUtility时有一些麻烦。 海关工作流程中的电子邮件方法。

private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e)
    {
        if (SPUtility.IsEmailServerSet(workflowProperties.Site.OpenWeb()))
        {
            StringDictionary headers = new StringDictionary();
            headers.Add("to", "myemailaddress@mailinator.com");
            headers.Add("from", "somebody@example.com");
            headers.Add("content-type", "text/html");

            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                bool test = SPUtility.SendEmail(web, headers, "some message body");
            });
        }
    }

在上述法典中,万国邮联的方法。 SendEmail总会退回伪造。

I ve even tried to use RunWithElevatedPrivileges, but still the method returns false.

标记组合不是问题,因为分配任务时的标准电子邮件通知是完全正确的。

奇怪的方面是,我利用时间过长的工作,尝试了这一信使方法,而且这一方法正在完全罚款。

如果我需要补充上述方法,请有人帮助我。

感谢。

最佳回答

I couldn t find the root of this problem. I decided to do create 2 workflow: the first is to send the email using initiation parameter (build using sharepoint designer). the second one is workflow that initiate the first workflow.

它现在起步运行。

问题回答

希望在提升的特权范围内查阅网站。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签