Text is getting cut off in VML CTA on Outlook 2013 120DPI - html-email

I am using VML to make my bulletproof CTAs work in Outlook, they seem to be working fine everywhere except on Outlook 2013 120DPI where the text is cut off in the CTA:
Everywhere else it works fine:
Here is the VML:
<!--[if mso]>
<v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="https://epredia.com/" style="height:34px;v-text-anchor:middle;width:176px;" arcsize="33.5px" strokecolor="#E5E5E6" fillcolor="#E5E5E6">
<w:anchorlock/>
<center style="color:#58595B;font-family:Helvetica, HelveticaArial, sans-serif, HelveticaNeueLTStd-Bd;font-size:18px;line-height:18px;">
<b style='font-family:Helvetica, HelveticaArial, sans-serif, HelveticaNeueLTStd-Bd;'>
Mini CTA
</b>
/center>
</v:roundrect>
<![endif]-->

You need to set the scaling.
Have your HTML tag something like this (you might have different language or other attributes):
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
And in your <head> add this:
<!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml><![endif]-->

Related

How to Escape Double Quotes on Prolog Web Server

I used the following Prolog code to display an HTML form with info_server(8000). but it doesn't work when a form item contains double-quotes. How can I escape the double quotes?
:- use_module(library(http/thread_httpd)).
:- use_module(library(http/http_dispatch)).
:- use_module(library(http/http_error)).
:- use_module(library(http/html_write)).
:- use_module(library(http/http_client)).
:- http_handler('/', info_web_form, []).
info_server(Port) :-
http_server(http_dispatch, [port(Port)]).
/*
browse http://localhost:8000/
*/
info_web_form(_Request) :-
format('Content-type: text/html~n~n', []),
data(Header,Footer),
Loads the header and footer of the web page, which it reuses on different pages
format(Header,[]),
Displays the header
middle_form,
Displays the form
format(Footer,[]).
Displays the footer
% When the form is submitted, it displays the landing page.
:- http_handler('/landing', landing_pad, []).
landing_pad(Request) :-
member(method(post), Request), !,
http_read_data(Request, Data, []),
format('Content-type: text/html~n~n', []),
Data=[input=Input1, info=Hidden1, submit=_],
format(Input1,[]),
format(Hidden1,[]),
Displays the hidden data from the form, which is cut off because it contains double-quotes.
data(Header,Footer),
format(Header,[]),
middle_form,
format(Footer,[]).
data(Header,Footer) :-
Header='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Title</title>
<style type="text/css">
<!--
A:link {text-decoration: none;}
A:visited {text-decoration: none;}
A:hover {text-decoration: underline;}
img {
height: auto;
max-width: 100%;
object-fit: contain;
}
table {table-layout: fixed; width: 100%;}
td {word-wrap: break-word;}
-->
</style>
<!-- Displays text at readable size on both desktops and mobiles -->
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<!-- salmon coloured -->
<body style="background-color: rgb(255, 239, 227);">
<div style="text-align: center;">
<table width="80%">
<tbody>
<tr>
<td>
<p>',
Footer='</p>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</body>
</html>'.
middle_form :-
Below is the hidden data, which is cut off with the double quote.
Hidden=[[a],"A",'a'],
term_to_atom(Hidden,Hidden1),
Hidden1=Hidden2,
concat_list(["
<form action=\"/landing\" method=\"POST\">
<label for=info></label>
<input type=text id=input name=input value=''><br><br>
<input type=hidden id=info name=info value=\"",Hidden2,"\"><br><br>
<input type=submit name=submit value='Submit'>
</form>
"],Form_text1),
The call to atom_string below displays the form as an atom.
atom_string(Form_text,Form_text1),
format(Form_text,[]).
The replace_new predicate replaces strings with strings in a string, for example
replace_new('0ab0','a','c',A).
A = "0cb0".
replace_new(A1,Find,Replace,F) :-
string_length(Replace,Replace_l),
string_concat("%",A1,A2),
string_concat(A2,"%",A), split_string(A,Find,Find,B),findall([C,Replace],(member(C,B)),D),maplist(append,[D],[E]),concat_list(E,F1),string_concat(F2,G,F1),string_length(G,Replace_l),
string_concat("%",F3,F2),
string_concat(F,"%",F3),!.
concat_list concatenates a list of strings to a string, for example:
concat_list(["a","b","c"],D).
D="abc"
concat_list([],""):- !.
concat_list(A1,B):-
concat_list("",A1,B),!.
concat_list(A,List,B) :-
concat_list1(A,List,B).
concat_list1(A,[],A):- !.
concat_list1(A,List,B) :-
List=[Item|Items],
string_concat(A,Item,C),
concat_list1(C,Items,B).
When I view the web page at http://localhost:8000/, the hidden info value is partially lost when displayed on the landing page.
I worked out how to escape the double quotes, and it involved changing the code above from:
Hidden1=Hidden2,
to:
replace_new(Hidden1,"\"",""",Hidden2),
Making these changes replaces double quotes with " and preserves the form data.
Note: This also assumes that the programmer uses double quotes around form data in <input type=hidden id=info name=info value=\"",Hidden2,"\">, eliminating single quotes in the data causing an error.

ASP, vbscript, CDO Email through AWS is truncated?

I am moving this classic ASP app to AWS and using AWS SES SMTP to send site emails (automated, post registration email).
So, the code below works but when the email arrives it is truncated (incomplete)?
Mail Function:
Function Sendmail(Sender, Subject, Recipient, Body)
dim myMail, strServer
strServer = Request.ServerVariables("server_name")
if strServer <> "localhost" then
Set myMail=Server.CreateObject("CDO.Message")
myMail.Subject=Subject
myMail.From=Sender
myMail.To=Recipient
myMail.HTMLBody=Body
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver")="email-smtp.us-east-1.amazonaws.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport")=465
'requires authentication
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate")=1
'username
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername")="a username"
'password
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword")="a password"
'startTLS
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl")=true
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
end if
End function
Mail Body
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'><html lang='en'><head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1258'> <meta name='viewport' content='width=device-width, initial-scale=1'> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <meta name='format-detection' content='telephone=no'> <title>Title</title> <link rel='stylesheet' type='text/css' href='http://www.website.com/styles.css'> <link rel='stylesheet' type='text/css' href='http://www.website.com/responsive.css'></head><body style='margin:0; padding:0;' bgcolor='#F0F0F0' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><table border='0' width='100%' height='100%' cellpadding='0' cellspacing='0' bgcolor='#F0F0F0'><tr><td align='center' valign='top' bgcolor='#F0F0F0' style='background-color: #F0F0F0;'> <br/> <table border='0' width='600' cellpadding='0' cellspacing='0' class='container'><tr><td class='header' align='left'><img src='http://www.website.com/images/email/logo_small_en.png'/> </td></tr><tr> <td class='container-padding content' align='left' bgcolor='#FFFFFF'> <br/><div class='title'>Welcome to the site! </div><br/><div class='body-text'> <p>Welcome to the website<div class='hr'></div><br/><div class='subtitle'>Have fun!</div><br/> </td></tr><tr> <td class='container-padding footer-text' align='left'><br/>© 2016 <br/> <br/>You are receiving this email because you registered for the website. Please click here to <a href=''>unsubscribe</a>. <br/> </td></tr></table></td></tr></table></body></html>
Truncated always at the same spot?
<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'><html lang='en'><head> <meta http-equiv='Content-Type' content='text/html; charset=windows-1258'> <meta name='viewport' content='width=device-width, initial-scale=1'> <meta http-equiv='X-UA-Compatible' content='IE=edge'> <meta name='format-detection' content='telephone=no'> <title>Title</title> <link rel='stylesheet' type='text/css' href='http://www.website.com/styles.css'> <link rel='stylesheet' type='text/css' href='http://www.website.com/responsive.css'></head><body style='margin:0; padding:0;' bgcolor='#F0F0F0' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'><table border='0' width='100%' height='100%' cellpadding='0' cellspacing='0' bgcolor='#F0F0F0'> <tr> <td align='center' valign='top' bgcolor='#F0F0F0' style='background-color: #F0F0F0;'> <br/> <table border='0' width='600' cellpadding='0' cellspacing='0' class='container'> <tr> <td class='he
I can't seem to track this down? Is the error in my function or the mail body? Is it an AWS limitation?
Thanks for your thoughts,
SMTP servers can throw a "Line too long" error when a line of the email exceeds some server-defined length. Since your message is always truncated at the same spot try inserting line breaks into your message body. I know AWS SES SMTP can return this error but I am unsure as to what the limit is. Here is a related conversation with a similar error and CDO for reference.
CDO uses 7bit for content transfer encoding by default, which does not truncate the long lines.
You don't need a user defined function but specify an appropriate content transfer encoding for the message body.
8bit, quoted-printable and base64 are standard transfer encodings will take care of the long lines.
'...
myMail.Configuration.Fields.Update
myMail.HTMLBodyPart.ContentTransferEncoding = "8bit"
myMail.Send
'...

how to get the file sent in xml response in perl?

Using the LWP user agent I am sending the request and getting the response.
I will get the response in html format and a file attached in it.
eg:
`<html>
<head>
<title>Download Files</title>
<meta http-equiv=\'Content-Type\' content=\'text/html; charset=utf-8\'>
<link rel=\'stylesheet\' href=\'http://res.mytoday.com/css/main.css\' type=\'text/css\'>
<link rel=\'stylesheet\' href=\'http://res.mytoday.com/css/Menu.css\' type=\'text/css\'>
<link rel=\'stylesheet\' href=\'/statsdoc/freeze.css\' type=\'text/css\'>
</head>
<body>
<table border=1>
<tr class=\'rightTableData\'>
<th>No.</th>
<th>File Name</th>
<th>File Size</th>
</tr><tr class=\'rightTableData\'>
<td>1</td><td>
<a href=\'/dlr_download?file=/mnt/dell6/SRM_DATA/data/API_FILE /20160329/LSUZisbZahtHNeImZJm_1-1.csv.zip\'>1-1.csv.zip</a>
</td><td>487 bytes</td> </tr>
</table>
</br></br>
<center><a href=\'/dlr_download?file=/mnt/dell6/SRM_DATA/data/API_FILE/20160329/LSUZisbZahtHNeImZJm-csv.zip\'>Download all</a></center>
</body></html>`
From this response I need to get the file. Can anyone help me to get the file from response.
Use a parser to extract the information. I used XML::LibXML, but I had to remove the closing br tags that made the parser fail.
#!/usr/bin/perl
use warnings;
use strict;
my $html = '<html>
<head>
<title>Download Files</title>
<meta http-equiv=\'Content-Type\' content=\'text/html; charset=utf-8\'>
<link rel=\'stylesheet\' href=\'http://res.mytoday.com/css/main.css\' type=\'text/css\'>
<link rel=\'stylesheet\' href=\'http://res.mytoday.com/css/Menu.css\' type=\'text/css\'>
<link rel=\'stylesheet\' href=\'/statsdoc/freeze.css\' type=\'text/css\'>
</head>
<body>
<table border=1>
<tr class=\'rightTableData\'>
<th>No.</th>
<th>File Name</th>
<th>File Size</th>
</tr><tr class=\'rightTableData\'>
<td>1</td><td>
<a href=\'/dlr_download?file=/mnt/dell6/SRM_DATA/data/API_FILE /20160329/LSUZisbZahtHNeImZJm_1-1.csv.zip\'>1-1.csv.zip</a>
</td><td>487 bytes</td> </tr>
</table>
<!-- </br></br> I had to comment this out! -->
<center><a href=\'/dlr_download?file=/mnt/dell6/SRM_DATA/data/API_FILE/20160329/LSUZisbZahtHNeImZJm-csv.zip\'>Download all</a></center>
</body></html>';
use XML::LibXML;
my $dom = 'XML::LibXML'->load_html( string => $html );
print $dom->findvalue('/html/body/table/tr[2]/td[2]/a/#href');
You could also use the recover flag to parse invalid HTML:
my $dom = 'XML::LibXML'->load_html( string => $html, recover => 1 );

less files importing but not styling

Here is a live example:
http://alkharia.com/layout/index.html
HTML:
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<html class="no-js"><!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link rel="stylesheet" type="text/css" href="assets/css/font-awesome.min.css">
<link rel="stylesheet/less" type="text/css" href="assets/less/app/core.less">
</head>
<body style="">
<!--[if lt IE 7]>
<div class="alert alert-danger">You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your experience.</div>
<![endif]-->
<header>
<section id="top-bar">
<div class="col-sm-6 col-sm-offset-4">
Login form
</div>
<div class="col-sm-2">
Create an account
</div>
</section>
</header>
<script type="text/javascript" src="assets/js/jquery.min.js"></script>
<script type="text/javascript" src="assets/js/less.js"></script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
</body></html>
So I included the less.js file along with the core.less file
The core.less file #import url("../bootstrap/bootstrap.less"); the bootstrap.less file while the bootstrap.less file imports all the relevant less files.
If you look under the Developer's Tools in Chrome, all less files are being included including ALL the bootstrap.less files that I wanted to import. So they are importing properly, however, they are not styling anything.
I even tried just the #import "path/to/bootstrap.less"; as well and it imports it just like it was.. but not styling.
My core.less file:
#import url("../bootstrap/bootstrap.less");
//
// Variables
// --------------------------------------------------
// Scaffolding
// -------------------------
#body-bg: #1d2a37;
#text-color: #3b3b3b;
// Links
// -------------------------
#link-color: #67ae10;
#link-hover-color: darken(#link-color, 15%);
// Typography
// -------------------------
#font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
#font-family-serif: 'AR JULIAN', serif;
#font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace;
#font-family-base: #font-family-serif;
#font-size-base: 1.2em;
#font-size-large: ceil((#font-size-base * 1.25)); // ~18px
#font-size-small: ceil((#font-size-base * 0.85)); // ~12px
#font-size-h1: 1.6em
#font-size-h2: #font-size-h1 - 0.1;
#font-size-h3: #font-size-h1 - 0.2;
#font-size-h4: #font-size-h1 - 0.3;
#font-size-h5: #font-size-base;
#font-size-h6: #font-size-base - 0.1;
#line-height-base: 1.56;
#line-height-computed: floor((#font-size-base * #line-height-base)); // ~20px
#headings-font-family: inherit;
#headings-font-weight: 400;
#headings-line-height: 1.1;
#headings-color: inherit;
I also tried removing all the variable overrides and just left the #import line, but it still just loaded the import files and not apply the styling.
HOWEVER, when I just <link> to bootstrap.less instead of going through my core.less file, it loads everything fine and the stylesheets get applied just fine. But of course, I want to be able to override bootstrap's variables.less file along with having my own stylesheet.
I'm doing #Adam's suggestion here : Bootstrap variable overriding with LESS
Thank you for any help..

GWT getAbsoluteLeft/Top returns wrong value in FF

when i call the getAbsoluteLeft/Top method i always get 0 in firefox. For the IE i get a value which seems to be correct. Are there known problems using these methods ? My problem is that i want to set the position of an element with the absolute position values of another element. Thanks in advance. Edit: Using GWT 2.0.3
kuku
EDIT Testcase:
1. The host page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Web Application Starter Project</title>
<script type="text/javascript" language="javascript" src="samplegwt/samplegwt.nocache.js"></script>
<script type="text/javascript" language="javascript">
function execute() {
var element = document.getElementById("paragraph");
if (element != undefined)
element.style.display = "block";
}
</script>
<STYLE TYPE="text/css">
#paragraph {
display: none;
}
</STYLE>
</head>
<body class="body" onload="execute()">
<div align="center">
<table>
<tr>
<td>
<p id="paragraph">
<input type="text" id="example" value="Foobar" > <img border="0" src="images/some.gif" alt="Test"></p>
</td>
</tr>
</table>
</div>
</body>
</html>
In the onModuleLoad() i simply do this: System.out.println(Document.get().getElementById("paragraph")
.getAbsoluteLeft());
Well as stated in the comments the problem was that the element is not visible which results into 2 different behavoirs for IE and FF.