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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:04:05+00:00 2026-06-04T13:04:05+00:00

I want to send user a localized email, but it seems the text retrieved

  • 0

I want to send user a localized email, but it seems the text retrieved from resource file are based on my culture.

SmtpClient client = new SmtpClient();
client.Host = "xxx.xxx.xxx";
client.Credentials = new NetworkCredential("name", "password");
MailMessage mm = new MailMessage();
mm.Sender = new MailAddress("xxx@xxx.com");
mm.From = new MailAddress("xxx@xxx.com");
mm.To.Add(new MailAddress(email));
mm.Subject = Localization.EmailUserActiveTitle;
mm.Body = "<div><h3>" + Localization.EmailUserActiveBodyPart1 + "</h3></div></br>" +
            "<div>" + Localization.EmailUserActiveBodyPart2 + "</div>" +
            "<div><b>" + content + "</b></div></br>" +
            "<div>" + Localization.EmailUserActiveBodyPart3 + "</div>" +
            "<div>" + Localization.EmailUserActiveBodyPart4 + "</div>";
mm.IsBodyHtml = true;
mm.Priority = MailPriority.Normal;
client.Send(mm);

But when i retrieve Localization.EmailUserActiveBodyPart1 it is localized base on my current culture.

how can i retrieve specified culture resource file?

  • 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-06-04T13:04:06+00:00Added an answer on June 4, 2026 at 1:04 pm

    The ResourceManager uses the Thread.CurrentThread.CurrentUICulture property to determine which localized language version of a resource to load.

    So if you want to force localization to a specific language (e.g. the language preference associated with the user you are sending email to), then just do this before your code:

    var previousUICulture = Thread.CurrentThread.CurrentUICulture;
    Thread.CurrentThread.CurrentUICulture = new CultureInfo("fr-FR"); // Replace with the relevant culture name for your user
    

    And clean up* just after your code:

    Thread.CurrentThread.CurrentUICulture = previousUICulture;
    

    *Obviously this is not a reliable clean-up. A finally block or wrapping this language-switching functionality in an IDisposable and using a using block would prevent your code running in a random language in case of a failure, but that’s outside the point.

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

Sidebar

Related Questions

i want to send an email to user after he sign-up with code.for ex
I want send a email by Email Class in codeigniter with gmail, but i
I want to send the HTML email to new registered user. I am using
i have SWF file. i want to send the user to another page when
i want to send mail to user when registered but error (The SMTP host
I want to send an email with login details to user emailaddress whenever Admin
I want to send a user feedback form through email. when they press submit
I am getting data from severs in json format but i want that user
I want to send email of a user to foursquare and get permission about
I want to send the email to the sharepoint adminsitrator when user clicks the

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.