I pass the HTML markup into the SmtpClient object and send it:
using (SmtpClient SMTP = new SmtpClient(Settings.SmtpServer))
{
using (MailMessage message = new MailMessage())
{
message.From = new MailAddress(Settings.EmailFromAddressUS);
message.To.Add(new MailAddress(orderInfo.ShippingInfo.Email, string.Format("{0} {1}", orderInfo.ShippingInfo.FirstName, orderInfo.ShippingInfo.LastName)));
message.Subject = subjectLine;
message.Body = emailBody;
message.IsBodyHtml = true;
SMTP.Send(message);
}
}
Inside emailBody variable I have such mark up:
<a href="www.test.com" style="background-color: transparent;Margin:0;border:0 solid #46323c;border-radius:4px!important;border-collapse: separate;perspective: 1px; color:#46323c;display:inline-block;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:700;line-height:1.3;margin:0;padding:8px 16px 8px 16px;text-align:left;">Sign Up</a>
On the client's side (Outlook 2016) that's the html received:
<a href="www.test.com" style="border-radius:4px!important;perspective: 1px;display:inline-block"><b><span style="color:#46323C;border:solid #46323C 1.0pt;mso-border-alt:
solid #46323C .25pt;padding:6.0pt;text-underline:none">Sign Up </span></b></a>
The border-radius property is not applied and the button is squared. If I save the email as html I will have a rounded button as it should be.
if it is outlook, it may not be passed, the following pass:-
border-left
border-right
border-top
border-bottom
border-left-color
border-left-width
border-left-style
border-right-color
border-right-width
border-right-style
border-top-color
border-top-width
border-top-style
border-bottom-color
border-bottom-width
border-bottom-style
border-radius is at the helms mercy of outlook, can you please confirm which client you need to pass? border-radius will not work on specific outlook versions, particularly when it comes to litmus version testing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With