F
fhtino
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
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