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

  • SEARCH
  • Home
  • 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 6793815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:08:45+00:00 2026-05-26T18:08:45+00:00

string BODY = String.Empty; string PageName = @[C:\Users\User1\Desktop\SK\Resources\HTMLEmail\email.html]; BODY = new StreamReader(PageName).ReadToEnd(); I am

  • 0
   string BODY = String.Empty; 
            string PageName = @"[C:\Users\User1\Desktop\SK\Resources\HTMLEmail\email.html]";  
            BODY = new StreamReader(PageName).ReadToEnd(); 

I am reading a HTml File in my C# code using the above code, what I want to do is add some text to the file and save it or I have to send the file to a method which sends a email with the file.

the code below is from the email.html I have to add the Email Address and password in the [Email Address] and [Password]. How can i add text to the read HTML. And how can I send it to the method after doing the edit. Thanks

 <tr>
       <td valign="top">
        <div mc:edit="std_content00">
            <h4>Welcome to Website</h4>
               <p>Your new login details are:</p>
               <p>Email address: [Email Address]</p>
               <p>Password: [Password]</p>

Sending the file to the webservices which sends the email along with the HTML page
//call the webservice to send email to the newly created user
ServiceClient service = new ServiceClient();
service.sendEmail(newuseremail, subject, BODY);

  • 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-26T18:08:45+00:00Added an answer on May 26, 2026 at 6:08 pm

    Maybe it’s not elegant nor the best solution, but it’s fast and easy:

    BODY = BODY
           .Replace("[Email Address]", email)
           .Replace("[Password]", password);
    File.WriteAllText(newFilename, BODY);
    

    Just a suggestion: to read BODY variable you’d better using

    string BODY = File.ReadAllText(filename);
    

    without the need to use streams (I think your email template is short…)

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

Sidebar

Related Questions

MailMessage message = new MailMessage(email.From, email.To, email.Subject, email.Body); message.BodyEncoding = Encoding.GetEncoding(utf-8); string body =
I am using aptana radrails empty rail project : scaffold Article titre:string body:text categorie_id:integer
I have a html string like this: <html><body><p>foo <a href='http://www.example.com'>bar</a> baz</p></body></html> I wish to
why this.style[property] get an empty string? my code is: <!DOCTYPE html> <html> <head> <title>Demo</title>
I have a single AMQ queue that receives simple messages with string body. Consider
What am I doing wrong here? private void SendMail(string from, string body) { string
string [] files = new string[2]; files[0] = ThinkFarAhead.Example.Settings.Configuration_Local.xml; files[1] = ThinkFarAhead.Example.Settings.Configuration_Global.xml; //Resharper complains
string[] filesOfType1 = GetFileList1(); string[] filesOfType2 = GetFileList2(); var cookieMap = new Dictionary<string, CookieContainer>();
I got the following very basic template: <html> <head> </head> <body> <div> <!-- Using
I have a very simple form where users can enter their email and click

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.