Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6701651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:57:35+00:00 2026-05-26T06:57:35+00:00

I have some trouble when using SPUtility.SendEmail method in a custom workflow. private void

  • 0

I have some trouble when using SPUtility.SendEmail method in a custom workflow.

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");
            });
        }
    }

in the code’s above, the method SPUtility.SendEmail always returning false.

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

The smtp configuration is not the problem, because the standard email notification when a task is assigned in sharepoint is sent all right.

The strange part is, I have tried this SendEmail method using a timer job, and the method is working perfectly fine.

please somebody help me if there is something i need to add to my method’s above.

thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:57:35+00:00Added an answer on May 26, 2026 at 6:57 am

    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.

    it’s now up and running.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, I have some trouble using the stream_publish method, more exactly with the attachment
I have created some rounded navigation tabs using CSS and am having trouble when
I have some trouble with using authlogic in my rails app, so I began
i am using c++ and i have some trouble about pointers i know that
I'm having some trouble using constraints correctly. I have three tables, 'item', 'store' and
I am having some trouble using the GTK Expander widget. I have several expanders
I'm having some trouble using sessions with php.. I think I have figured out
I have some trouble using an Ajax query in a Rails + JQuery ecosystem.
I have some trouble getting the VCS of teamcity work. I'm using perforce and
We are using Joomla 1.5.21 and JCE 1.5.7 and have some trouble with the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.