SendEmail and special character in State Machine Workflow

Hi,


I use a SendEmail activity in a State Machine workflow (SharePoint 2010) to send an email.

The body message may contain french characters (, ...) but it seems these characters cannot be used because they are automatically replaced (even through there is no problem logging them using SPWorkflow.CreateHistoryEvent)

        private void sendEmailToFixIncident_MethodInvoking(object sender, EventArgs e)
        {
            SendEmailTo = RetrieveEmailTo();
            SendEmailSubject = "something";
            LogComment(MessageBody()); //OK  lsve de l'oral
            SendEmailBody = MessageBody(); //Received email with C)lsC(ve de l'orC*al
        }


July 1st, 2013 11:04am

When setting the message body use Httputilility.htmlencode / Httputilility.htmldecode . I dont remember the correct one pls try it out.
Free Windows Admin Tool Kit Click here and download it now
July 1st, 2013 10:10pm

I am not sure where to use the Httputility.encode/decode. MessageBody() is a string method.
July 1st, 2013 11:33pm

SendEmailBody = SPHttpUtility.HtmlDecode(EmailBodyDev());
SendEmailBody = SPHttpUtility.HtmlDecode(EmailBodyDev()); //returns the same thing 
C)lsC(ve de l'orC*al

SendEmailBody = SPHttpUtility.HtmlEncode(EmailBodyDev()); //I can see the html code because my string method returns some html code


Free Windows Admin Tool Kit Click here and download it now
July 2nd, 2013 9:26am

still couldnt find a fix for this... does anyone have an idea?
July 3rd, 2013 5:48am

Ya sure. in the second say, where you get the html use it . Now please set the property ishtml to true. This will   mostly be availabe with the body tag.
Free Windows Admin Tool Kit Click here and download it now
July 3rd, 2013 8:10am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics