Problem with SendEmail in SharePoint workflow.

by | Aug 27, 2010 | Development, SharePoint | 0 comments

Recently I had strange problem. I’ve created workflow with Visual studio 2008 which and I would like to use Workflow component: “SendEmail” for some cases. And if I enter directly into component email address for field: “TO” the message will be delivered. But if I use simple code with the same email address for field ”TO” it doesn’t work (field TO is empty now).

private void sendEmail_ExecuteCode(object sender, EventArgs e)

{

sendWithInformation.To = @”[email protected]” ;

sendWithInformation.Subject = “Subject” ;

sendWithInformation.Body = “Body message” ;

}

And I need this code as in production environment field TO will be changing. There were just entry in log file:

08/24/2010 16:02:06.99 w3wp.exe (0x021C) 0x16F8 Windows SharePoint Services General 8kh7 High Can’t finish this action . Try again.

So, what’s going on? I try different solutions and without any result. Until I get response from Ginni Sharma on my post  . It was necessary to create variable for this component which holds “TO” field. And then If I assign email address to it message will be delivered. Strange…

Written by Tomasz Szulczewski

Hi, my name is Tomasz Szulczewski, and I have been in love with information technology for over 25 years, but I still have an IT passion and feel like a geek. I am a person who is problem solver who thinks that not all people must be experts in IT.

Related Posts

What is SharePoint in Office 365?

What is SharePoint in Office 365?

What is SharePoint in Office 365, and why is SharePoint for small business the critical product? So you bought a Microsoft 365 license, and your tenant is online. You open a browser, and you have no idea what to do next? Don't worry; I will try to give you a few...

read more
Hubfly

Hubfly

A few days ago I have a chance to play with SharePoint online solution called Hubfly and I was really impressed with his capabilities. And here is my review. So let’s start from the begging. I wrote a few times on this blog that the main problem with SharePoint is...

read more

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.