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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:16:56+00:00 2026-05-27T10:16:56+00:00

I wrote a C++ application that needs to send emails. It does this by

  • 0

I wrote a C++ application that needs to send emails.

It does this by calling

/usr/sbin/sendmail -f [sender] -t

and then writing the mail headers and body to the standard input of the sendmail process.

Everything works fine – except for umlauts or other non-ASCII characters.
How can I make them working correctly?

I already tried to set

Content-Type: plain-text; charset=ISO-8859-1  

as a mail header and also

Content-Type: plain-text; charset=UTF-8

didn’t change anything. Seems like this header is ignored.

  • 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-27T10:16:57+00:00Added an answer on May 27, 2026 at 10:16 am

    Anything other than ASCII in an email message should typically be encoded either as quoted-printable or base64. The Content-Transfer-Encoding and Content-Type headers are then set accordingly so that the recipient knows how to decode the message back to non-ASCII text.

    Here’s a bash example that illustrates how this can be done on the command line:

    #!/bin/bash
    message="Hellö ümläüts"
    encoded=$(base64 <<< "$message")
    
    /usr/sbin/sendmail -t <<< "From: sender@example.com
    To: recipient@example.com
    Subject: Dear friend
    Content-Transfer-Encoding: base64
    Content-Type: text/plain; charset="utf-8"
    
    $encoded"
    

    You need to specify whatever character encoding was used to convert the string to binary before the data was base64 encoded.

    This example uses utf-8, because that is a common platform default so most shells would use utf-8 when converting the string to binary and passing it to base64 on stdin.

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

Sidebar

Related Questions

I am working on an iphone application that needs to send some images over
My application needs to send thousands of emails on a daily basis. So I
I wrote simple application that send some data to my server. Somehow the data
I'm trying to write a small application that needs to use the clipboard for
I have a console application project in C# 2.0 that needs to write something
I wrote an application that currently runs against a local instance of MySql. I
I wrote an application that loops through a set of records and prints two
I am writing C# application that need to print data to POS STAR printer
I've been writing an application that monitors certain directory for files being added, and
We are writing an application which needs a dummy user as a socket.io client

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.