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 1104641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:30:43+00:00 2026-05-17T01:30:43+00:00

I am using this code to send email var message = new MailMessage(abc@somedomain.com, administrator@anotherdomain.com);

  • 0

I am using this code to send email

var message = new MailMessage("abc@somedomain.com", "administrator@anotherdomain.com");
message.Subject = "Testing";
message.IsBodyHtml = true;
message.Body = "<html><body>IMAGINE A LOT OF HTML CODING HERE</body></html>";

The problem is I just copied the HTML that I want to send as email and now I have to make the whole HTML code in ONE single line! Otherwise it is saying “;” missing! I mean, now I can’t keep on removing spaces and put it ALL in one line! It’s too much HTML code that I need to send. What do I do ? :/

[EDIT]
Another question: Is there a limit to this message.Body? Like a limit to how much HTML can be inserted in this?

  • 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-17T01:30:44+00:00Added an answer on May 17, 2026 at 1:30 am

    Dan has given one option – verbatim string literals – but I’d like to suggest that you move the data into a separate HTML file. Embed it as a resource within your assembly, and then you can load it in at execution time.

    That way you’ll get HTML syntax highlighting, you won’t clutter up your code with a lot of data, and you can edit it really easily at any time, without having to worry about things like double quotes (which would need to be doubled within a verbatim string literal, or escaped with a backslash in a regular string literal).

    The downside is that it becomes harder to put user data within the HTML – for that, you might want to consider using a templating system; either simply handwritten (html = html.Replace("$user", name)) or one of the various templating libraries available. Be careful to use HTML escaping where appropriate, of course.

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

Sidebar

Related Questions

I'm using code like this to send email: var smtp = new SmtpClient {
I am using this code to send mail with php http://www.siteduzero.com/tutoriel-3-35146-e-mail-envoyer-un-e-mail-en-php.html#ss_part_4 . This code
Im using this code for mysql connection $con = mysql_connect(localhost:/var/lib/mysql/mysql.sock, abc , xyz); if
I'm using CakePHP to send an email. My controller code looks like: if ($this->User->save($this->request->data))
Using this code, i am able to send a notification to my own device.
i'm using MFMailComposer to send an image.m using this code MFMailComposeViewController *picker = [[MFMailComposeViewController
I have this code written in .NET 4.0 using VS2010 Ultimate Beta 2: smtpClient.Send(mailMsg);
Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:
When using this code: <script> $(document).ready(function () { $.getJSON(http://twitter.com/statuses/user_timeline/USERNAME.json?callback=?, function(data) { if(data[0].text.length > 107)
I am using the following code to send an email attachment. I'm using C#,

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.