How to stop HTML email <img> src attribute from being removed - html

The IMG src attribute is removed from tag and only ALT text is displayed in HTML email. Below is the container table from the banner that contains the image. This works fine when I display the HTML page in IE or Chrome. But when I run it through GoDaddy, the SRC attribute is deleted and the ALT text is not formatted as indicated in the IMG tag. How do I prevent this from happening?
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="table-layout: fixed; ">
<tr>
<td align="center" bgcolor="#efeac9" style="padding: 20px 0 0px 0;">
<div style="display: none; font-size: 1px; color:#efeac9; line-height: 1px; font-family: Arial, sans-serif; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden; mso-hide: all;">
This won't be shown in the design, but will be visible in the inbox preview.
</div>
<table border="0" cellpadding="0" cellspacing="0" width="600" class="wrapper">
<tr>
<td>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" bgcolor="#efeac9" class="logo">
<img src="Images/WP_Email_Banner.png" alt="Wisconsin Pollinators" height="252" width="600" border="0" style="display: block;
padding: 0; color: black; font-family: Arial, sans-serif; font-weight: bold; font-size: 24px; background-color: #efeac9;
-webkit-border-radius: 10px; border-radius: 10px;" class="fluid-image"/>
<!--<img src="Images/WP_Email_Banner.png" height="252" width="600" border="0" style="display: block; padding: 0;"/>-->
</td>
</tr>
<tr>
<td align="center" bgcolor="#ffffff" style='font-family:Verdana; font-weight: bold; color:#943E58; font-size: 20px; line-height: 24px; padding: 15px 0px 15px 0' class="mobile-title-pad">
WELCOME TO<br />WISCONSIN POLLINATORS
</td>
</tr>
</table>
</table>
</table>
Thanks for your help!

I hope you speak for the following image tag:
<img src="Images/WP_Email_Banner.png" alt="Wisconsin Pollinators" height="252" width="600" border="0" />
First check if the filename is correct.
Then check if the path is correct. If your image folder is outside of your html page use the following format "../Images/WP_Email_Banner.png"
Finally try to upload your image to your ftp client and use the url link in the src atrribute (like http://yourwebsite.com/Images/WP_Email_Banner.png. Check again and if you have problems comment.

Remove extra options from image tag and try this
<img src="Images/WP_Email_Banner.png" alt="Wisconsin Pollinators" height="252" width="600" style="display:block;" />
And you also using css class. In email it will not work so use inline css as you are already using.

Please Upload the image on a public url and use its link as img tag's src value.
When you send an email with attachment, the HTML content does not have access to the file system, hence local images do not show up as you expect them to be shown. I faced this with Outlook web and solution was to host the images on public URL.

Related

How to remove "ghost" line showing up in a coded html email?

Sample Code:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<title></title>
</head>
<body style="font-family: Arial; margin: 0; padding: 0;">
<table align="center" width="600" cellpadding="0" cellspacing="0" border="0" style="width: 600px; background-color: #000000; font-family: Arial; font-size: 15px;color: #ff0000;">
<tr>
<td style="padding:10px;font-weight: bold;font-size: 20px; color: #ff0000;">Header Title</td>
</tr>
<tr>
<td style="padding:10px;">Here is the content for this section.</td>
</tr>
<tr>
<td style="padding:10px">
<img src="LearnMore.png" width="170" height="38" border="0" alt="Learn More" />
</td>
</tr>
</table>
</body>
</html>
Output for Office 365 in windows 10
All other clients seem to be fine.
Attempted the fixes from here
Looks like if a font size of 12px or 16px doesn't show the line but the requirement is to use 15px
expected result
The problem is often due to a rounding error in the Outlook engine (MS Word) with odd numbers. In your case, you've already identified an even numbered font-size works. Seeing as that's the core error, and it's not a bug in your code, you have to weigh up whether the unsightliness of the line is worse than changing the size of the font.
If that's not acceptable, you may have luck by setting a line-height of 16px like so: font-size:15px; line-height:16px;.
If all else fails, you can set the font-size differently just for Outlook desktops: font-size:15px; mso-ansi-font-size: 16px;

Unnecessarily a check / tick mark appearing in my button [ made of anchor tag i.e. link ]

I'm using the following code to display a button to clients:
<table role="presentation" cellspacing="0" cellpadding="0" border="0"
style="border-collapse:collapse; background:#005984; width:auto;">
<tbody>
<tr style="height: 30px;">
<td style="height: 30px; padding: 5px 22px;">
<a class="button-a button-a-primary" href="https://google.in" target="_blank"
style="font-family: sans-serif; font-size: 15px; line-height: 15px; text-decoration: none; color: #ffffff;">
Click Here to begin </a>
</td>
</tr>
</tbody>
</table>
Note: My application sends mails to clients, hence client opens the mail on multilple devices/browsers.
Due to security concerns, No idea as of now, on which environment this issue appearing, will be updated if as I get.
My client is seeing an extra checkmark next to the button:
I cannot reproduce with same html as above. But somehow the client can and has sent me the previous screenshot.

Font isn't consistent on the old devices and platforms, and design elements break sometimes

I'm trying to unify the font to appear the same on all operating systems and devices. Also some design elements break on different devices. what am I doing wrong? this is my code below?
<table border="0" cellpadding="0" cellspacing="0" width="768">
<tbody>
<tr>
<td rowspan="4" border="0" cellpadding="0" cellspacing="0" height="100" width="250">
<img src="https://www.westcoastelevators.com.au/wp-content/uploads/2019/08/West-Coast-Elevators-Email-Signature-Image.jpg" alt="west coast elevators logo" width="350px" height="150" style=" margin-top: 28px">
</td>
<td colspan="4" height="20" width="200px"><p style="font-size:20px; margin-bottom: 5px; line-height: 20px; font-family: 'sans-serif', 'lato';"><strong>Full Name</strong><br>
<span style="font-size: 15px; font-family: 'sans-serif', 'lato'; color: #000000;">Managing Director</span></p></td>
</tr>
<tr height="10px" width="200px">
<td colspan="1" width="120px"><p style="margin-bottom: -0px; font-size: 15px">0000 000 000</p></td>
<td colspan="2" width="80px"><p style="margin-bottom: -0px;font-size: 15px">08 6263 5253</p></td>
</tr>
<tr>
<td height="47" colspan="3" width="220px"><p style="line-height: 0px; margin-top: 0px; font-family: 'sans-serif', 'lato';font-size: 15px">20 Wynyard St, Belmont WA 6104</p>
<p style="text-decoration: none; line-height: 10px; font-family: 'sans-serif', 'lato'; font-size: 15px">westcoastelevators.com.au </p></td>
<td width="180" ><img style="margin-right: 5px; margin-top: 10px" src="https://www.westcoastelevators.com.au/wp-content/uploads/2019/08/Artboard-3.png" alt="facebook logo"> <img style="margin-top: 10px" src="https://www.westcoastelevators.com.au/wp-content/uploads/2019/08/Artboard-4.png" alt="instagram logo"></td></tr>
</tbody>
</table>
This is a great tool for cross-browser/platform font issue: https://google-webfonts-helper.herokuapp.com/fonts/ try to download font from here and then import it in the css file.
To make the font constant everywhere, you would have to use a web font as Mr. Lister has said.
You could get fonts from all over the internet, but for now, getting fonts from here would be best.
An example, after selecting your font, you would import it into your HTML or CSS.
For HTML:
<body>
<link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
</body>
or
<style>
#import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
</style>
For CSS:
#import url('https://fonts.googleapis.com/css?family=Lato&display=swap');
Then to use it in your code (Note: This is how I would do it, after seeing what you are trying to do in your code):
<style>
#import url("https://fonts.googleapis.com/css?family=Lato&display=swap");
.p {
font-family: "Lato", sans-serif;
}
<!-- You will have to remove the font-family styling from all the tags though then leave this style tag in. -->
</style>
However, I strongly advise you look into external CSS. It would make your code much easier to work with.

Button looks squashed on email client

I am using the following code to create a button:
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td>
<table cellspacing="0" cellpadding="0">
<tr>
<td style="border-radius: 2px;" bgcolor="#1AB394">
<a href="https://www.example.com" target="_blank" style="padding: 8px 12px; border: none; border-radius: 4px; font-family: Helvetica, Arial, sans-serif; font-size: 14px; color: #ffffff; text-decoration: none; font-weight: normal; display: inline-block;">
CONFIRM ACCOUNT
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
The button is used in emails. When I send the email, the button looks fine on the web mail clients:
But doesn't look right on some other mail clients such as Outlook:
Can someone please help? Thanks.
You might want to take a look at this:
outlook-rendering-issues
Item #3.
I cannot test any of that because I do not use outlook as a client, but they seem to suggest that you might have to style the td enclosing the a tag more than you have. It does almost look like it is not treating the a tag as an inline-block like you have in your style. If you add the:
padding: 8px 12px;
to the enclosing td that might fix the appearance of the button.

how to remove the white space between two img when convert into oft format?

<table border="0px" cellpadding="0" cellspacing="0" width="700" height="50" style="margin:0px 0px 0px 0px;text-align:center;" >
<tr>
<td>
<p style="background-color:#dedede;line-height:25px;font-family: verdana,sans-serif;font-size:9px;">For more information on delegate registration and sponsorship opportunities</p>
<img style="margin-top:0;" width="700" height="9" src="http://i61.tinypic.com/28cfx3m.jpg" alt="bottombanner"/>
</td>
</tr>
</table>
Here's js fiddle.
In above code there is a white space occurs between that <p> & <img> tag, when it convert into oft format/email format. How to remove that white space without giving negative values.
thanks in advance.
Try adding vertical-align in img style
<img style="margin-top:0; vertical-align:top;" width="700" height="9" src="http://i61.tinypic.com/28cfx3m.jpg" alt="bottombanner"/>
Here is jsfiddle - http://jsfiddle.net/GWAkp/3/
Edited Code :--- See Edited p style
<table cellpadding="0" cellspacing="0" width="700" height="50" style="margin:0px 0px 0px 0px;text-align:center;" >
<tr>
<td>
<p style="background-color:#dedede;line-height:25px;font-family: verdana,sans-serif;font-size:9px;margin-bottom:0px; padding-bottom:0px;">For more information on delegate registration and sponsorship opportunities</p>
<img style="margin-top:0px; vertical-align:top;" width="700" height="9" src="http://i61.tinypic.com/28cfx3m.jpg" alt="bottombanner"/>
</td>
</tr>
</table>
JS Fiddle - http://jsfiddle.net/GWAkp/6/
Give display: block; to img
and margin: 0 to p
CSS
img {
display: block
}
p {
margin: 0
}
here is the demo