Why don't you just remove the headers it has by default, and add your own?
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Magician
A man, a plan, a canal.
a palindrome that has gone to s**t.
"fhtino" <fhtino@gmail.comwrote in message
news:1153991598.754561.20770@h48g2000cwc.googlegro ups.com...
Quote:
Hello,
>
I'm trying to create an email message with particular headers. A piece
of code:
>
SmtpClient smtp = new SmtpClient("192.168.x.y");
MailMessage msg = new MailMessage("from@xxxxxxx", "to@xxxxxx", "TEST",
"");
msg.Headers.Add("Content-Type", "application/pkcs7-mime;
smime-type=signed-data; name=\"smime.p7m\"");
msg.Headers.Add("Content-Disposition", "attachment;
filename=\"smime.p7m\"");
msg.Headers.Add("Content-Transfer-Encoding", "base64");
msg.Body = Convert.ToBase64String(encodedData);
smtp.Send(msg);
>
>
SmtpClient seems to not consider my headers and adds its headers.
>
The received message contains some headers twice:
>
content-type: application/pkcs7-mime; smime-type=signed-data;
name="smime.p7m"
content-disposition: attachment; filename="smime.p7m"
content-transfer-encoding: base64
mime-version: 1.0
from: xxxxxxxxxxxxxx
to: xxxxxxxxxxxxxxxx
date: 27 Jul 2006 11:02:43 +0200
subject: TEST
content-type: text/plain; charset=us-ascii
content-transfer-encoding: quoted-printable
>
>
There are 2 content-type and 2 content-transfer-encoding.
>
>
Is there a way to force SmtpClient to not add its own headers?
Or, if it's not possible, is there another way to achieve the same
result?
>
>
Thank you very much
>
>
Best regards
>
Fabrizio
>