Kamil
Kamil

Reputation: 812

text/plain and text/html with c++ mail

I am using System::Net::Mail to send emails. I was questioned about is it able to send two versions of email:

1) the html version of email for clients that can read html emails

2) text/plain for people who can't read html emails, and also the html version will be attached

is this possible using System::Net::Mail? I know how to enable HTML body version, but, how to send to types of message?

Thanks!

Upvotes: 1

Views: 215

Answers (1)

Oswald
Oswald

Reputation: 31685

To let the recipient decide which version she wants to read, the mail needs to be composed using the multipart/alternative MIME type. System.Net.Mail supports this by means of the System.Net.Mail.MailMessage.AlternateViews collection.

Upvotes: 2

Related Questions