none
Plain Text Email out of a Workflow RRS feed

  • Question

  • We have to send a workflow email into Tracket.  But this program does not like HTML emails.  How do you change the Send To Action to Plain Text instead of HTML?

     

    Wednesday, April 6, 2011 9:46 PM

Answers

All replies

  • Hi,

    There is no good way to change the behaviors of send to action.

    You can create a workflow using visual studio 2010 to send email through smtpclient and mailmessage classes.

    For more information, please refer to:

    http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.aspx

    http://msdn.microsoft.com/en-us/library/ms564355.aspx

    Regards,

    Seven

    • Marked as answer by Seven M Friday, April 15, 2011 3:44 AM
    Tuesday, April 12, 2011 7:30 AM
  • I have the same situation, and I don't think creating a VS workflow should be the answer. Everything that SharePoint does, and it can't send plain text email? 

    I tried sending plain text in Outlook and it works fine. I tried sending content from an InfoPath Library as plain text, but the annoying "<html><head><base href=3D'https://sharepoint.washington.edu/uwitsc' /></head>..." gets attached.

    If SharePoint is meant for the Enterprise, and it's common knowledge that the Enterprise uses tools as RT, which doesn't really like HTML, shouldn't SharePoint be able to send a plain text email?


    --

    Victor C.

    Tuesday, August 9, 2011 9:59 PM
  • Hi

    I managed to get my 3rd party system to accept an email from a SharePoint workflow by editing the properties of the Send Email action. See below:

    send email

    Using the string builder, i stripped all the HTML out and this worked for me.

    Cheers

    Asher


    Fast, Cheap, Good. Choose any Two!

    Friday, August 3, 2012 9:18 AM
  • This works for me in Visual Studio - SP2010 Workflow SendEmail as plain text:

    1. In the workflow designer, select the sendEmail activity. 

    2. In Properties window, bind Headers to a new property.   I'm sure a Field would work too but I went with a property knowing it would be typed as "System.Collections.Specialized.StringDictionary" (the UI shows the type).  That generates the required code for your new property with the get/set.  None of the generated property code should be changed but it might be interesting to look it over.

    3. I created a new StringDictionary object, set the key/value in the Add method and then assigned my new object to the property created in step 2.  I think it could be done in one step but IMO, this is easier to debug. 

    Here are the three lines I added to my MethodInvoking handler to make it work:

    System.Collections.Specialized.StringDictionary myHeaders = new System.Collections.Specialized.StringDictionary();
    myHeaders.Add("content-type", "text/plain");
    sendEmail1_Headers1 = myHeaders

    BTW, I see this was already marked as answered and then I noticed the original question was how to do this in SPD. 


    Dave Stinnett University of Tennessee


    • Edited by DStinnett Monday, August 20, 2012 2:09 PM
    • Proposed as answer by DStinnett Monday, August 20, 2012 2:23 PM
    Monday, August 20, 2012 2:05 PM
  • indeed, and the marked answer says you cant do it in SPD, but my solution is currently being used in our live systems!

    Fast, Cheap, Good. Choose any Two!

    • Proposed as answer by GregMcAllister Thursday, July 25, 2013 5:38 PM
    Monday, August 20, 2012 2:13 PM
  • Correct Asher, I agree. I find all too often that the monitors propose the answers incorrectly. More often than not, someone says try using something different instead of actually answering the question. Visual Studio IS NOT the answer to all the issues with SPD or SharePoint. Sometimes it could be any number of 3rd party tools or a little ingenuity. Thank you for your answer because it actually solves the problem.

    Greg McAllister

    Thursday, July 25, 2013 5:40 PM