When I use the AMPScript function HTTPGet(), I normally have no issues, but recently when I have inserted it to archive some of my email sends inside of a data extension I get a "HTTP request error (aka -2)" when it contains any MSO conditional statements. This is a bit of an issue as I need this to ensure Outlook displays correctly.

I am honestly stumped by this. The GET has no problem pulling in HTML or CSS comments, but the second I add in the [if mso] (also tried all possible values, e.g. gte mso 9) part, it errors.

Anyone have any ideas on WHY this is happening and whether there is any way to solve this without me removing the MSO conditional from my emails?

Sample Code: (had it set to only run on test send for me to test on it.)

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script runat="server" language="Ampscript">

IF _IsTestSend == true AND _messagecontext != "VAWP" THEN 

SET @VAWP = view_email_url
set @HTML = HTTPGet(@VAWP, true, 0, @CallStatus)

IF @CallStatus == 0 THEN
UPSERTDE("HTML_Archive", 1, "EmailName", emailname_, "HTML_Body", @HTML, "Date_Sent", NOW())
SET @error = "Call Error"

 SET @error = "HTML variable empty"



 <body width="100%" bgcolor="#DFDFDF" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
 %%=v(@CallStatus)=%%<br />
      <!--[if mso]>Outlook smells like butts.<![endif]-->
                  <table bgcolor="#FFFFFF" width="100%" cellpadding="0" cellspacing="0" border="0" style="border-collapse:collapse; max-width:640px;">
        <td align="center">WOOOOOOOOOOO!</td>

Open the email in Email Studio and view Properties. Change the language to 'ASCII' and save your changes, then try previewing the email.

  • Thanks elliot, your answer was a little off, but led me to the right spot. It was already on utf-8. For the conditionals to work I needed it to be ASCII! I am going to mark this answer as correct - could you edit to reflect this? Thanks! Oct 8 '16 at 13:32
  • Thanks @Gortonington, I was doing this from memory, I recall it was either ASCII or UTF-8 and I picked the wrong one — blame my exhausting trip back from DF16. Anyway, glad to hear this is resolved for you. Oct 8 '16 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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