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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:08:44+00:00 2026-06-01T14:08:44+00:00

I`m trying to send e-mail via c# and use the following code: public static

  • 0

I`m trying to send e-mail via c# and use the following code:

public static bool SendSMTPMail(string smtphost, int smtpport, string smtplogin, string smtppassword, string from, string to, string subject, string body, bool isHtml)
{
  try
  {               
    using (MailMessage message = new MailMessage(from, to, subject, body))
    {
      message.IsBodyHtml = isHtml;
      message.SubjectEncoding = System.Text.Encoding.UTF8;
      message.BodyEncoding = System.Text.Encoding.UTF8;

      SmtpClient mailClient = new SmtpClient(smtphost, smtpport);
      mailClient.EnableSsl = false;
      mailClient.DeliveryMethod = SmtpDeliveryMethod.Network;
      mailClient.Credentials = new NetworkCredential(smtplogin, smtppassword);

      mailClient.Send(message);
      return true;
    }
  }
  catch
  {
    return false;
  }
}

It works fine, when mails recieved in Windows, but when user trying to read them in MacOS – subject header is in wrong encoding.
If I set subject encoding to Windows-1251, it works good, but only for cyrillic subjects, and I`m going to send asian too…

How can I send emails using pure Unicode?

And the second question – if I`ll add any attachment to the mail, it will be added with extra files – “filelist.xml” and “header.htm”.

How to get rid of them?

Thaks!

  • 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-01T14:08:45+00:00Added an answer on June 1, 2026 at 2:08 pm

    About my second question found this, and it`s helps

    For encoding issues I choose to send mails with subjects in english only…

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

Sidebar

Related Questions

I'm trying to use the code below to send messages via System.Net.Mail and am
I am trying to invoke sendmail via PHP's mail function by the following code:
I'm trying to send a mail using Zend_Mail using the following code: function sendMail()
I am trying to send mail via SMTP in Perl. I have written a
I'm trying to send mail via the PHP mail() function which as far as
I'm trying to send an email via some C# ASP.NET code. This is being
I am trying to send an email, via php's mail function to user's every
I'm trying to send an email from c# code via our company's exchange server.
I am trying to get php to send mail via the mail() command, on
I am trying to send an email via GMail from ASP.Net using the code

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.