Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5839265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:33:41+00:00 2026-05-22T11:33:41+00:00

Why when i send html email it looks like: but initial page is: Here

  • 0

Why when i send html email it looks like:

enter image description here

but initial page is:

enter image description here

Here is code:

MailMessage message = new MailMessage();
                message.IsBodyHtml = true;
                message.Subject = subject;
                message.Body = body;

                foreach (MailAddress recipient in recipients)
                {
                    message.To.Add(recipient);
                }
                if (message.To.Count > 0)
                {
                    SmtpClient smtp = new SmtpClient();
                    smtp.Send(message);
                    return true;
                }

Html file contains css in head.
http://pastebin.com/r5V6X4Ld

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:33:41+00:00Added an answer on May 22, 2026 at 11:33 am

    I assume that the body variable only contains the HTML code, but not the CSS or the images, because both are separate files.
    Basically, you need to attach the images to the mail and change the HTML code of the body to point to the correct location. See here for more info and sample code.

    This might also be helpful: http://www.alistapart.com/articles/cssemail/

    Problem:

    Some clients rendered my email with no style whatsoever. I first attributed this to the stripping of styles, but I then discovered that the styles were clearly visible in the source code. I subsequently spent a good deal of time attempting to uncover the culprit, testing countless versions of the email. Alas, the problem was right under my nose: the styles weren’t being stripped — the dots (.) preceding their names were. Therefore, “.Feature {}” became “Feature {}”, resulting in a meaningless style definition.

    Solution:

    I used class selectors, which ensured that each style would begin with a letter instead of a dot. So “.Feature {}” would become “td.Feature {}” or “div.Feature {}” (depending on the application). A somewhat mundane fix, but effective and (again) compliant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to send an html email with a link but want it
i'm new with python.. Actually, i'm trying to send featured email with python: html
I wrote some code to send email as both HTML & Text, and I
I want to send the HTML email to new registered user. I am using
I am trying to send in PHP an HTML email but it always shows
I am trying to send an HTML email using Perl. open(MAIL,|/usr/sbin/sendmail -t); ## Mail
How to send HTML content in email using Python? I can send simple texts.
I have a couple of simple forms that send an html-only email. Most clients
I've got a C# application going that needs to send out an html email
I am sending email through gmail, i want to send some html content, is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.