Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I would like to send an email from my workflow. The email must be sended as html because I have an a href tag inside of it. See code below with my current code:

string ClientEmailBody = string.Format("Er is een nieuw wijzigingsverzoek voor beoordeling <a href='{0}'>{1}</a>", someUrl, someTitle);

    bool sendMail = SPUtility.SendEmail(workflowProperties.Web,true,true,ClientEmail,ClientEmailSubject,ClientEmailBody);

Sometimes the a href is OK. But sometimes it is not working. If the url is not working I got the following url:

http://mywebsite.nl/owa/UrlBlockedError.aspx

I dont use special urls, but normal. See here an example of the url:

http://mywebsite.nl/sites/RFC2/Lists/Impactanalyses/DispForm.aspx?ID=3

Do I need to explicit send the mail as html?

share|improve this question
add comment

1 Answer 1

A few items for thought.

  1. Try performing a URLEncode on your HREF within your string, just to make sure none of the ampersands and such are viewed as problematic characters
  2. Try replacing the single quotes with double quotes for your href attribute value
  3. Have you tried sending the emails to other email account types (yahoo, gmail, etc)? Even if this is only meant to be sent to internal staff, it would be good to verify that it's not an issue with how you're composing the emails themselves, but perhaps a security limitation of your email provider. If it's only your internal email that's causing a problem, hopefully it's just some settings you have to tweak on your mail server.

Hope this helps, good luck

share|improve this answer
    
I try above, but it dont work. I think it is an echange problem because when I change the hostname ot my live website hostname it works. With the hostname of my test environment it is not workin. –  KHA Mar 12 '13 at 10:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.