468,719 Members | 1,761 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,719 developers. It's quick & easy.

BUG: Periods / Fullstops removed from MailMessage attachments

Hi

I have come across an apparant bug while using SmtpMail. The problem I have
is that if a MailAttachment has a line in it that starts with a fullstop (
or period for those of you that speak American english ) then the fullstop
is removed. This is an example of how I am using SmtpMail and MailMessage:

MailMessage mail = new MailMessage();
mail.From = "fr**@test.com";
mail.To ="to@test.com";
mail.Subject = "Where did the . go?";
mail.Body = "Test";
mail.BodyFormat = MailFormat.Text;
mail.Attachments.Add( ( new MailAttachment( "C:\\Test.txt" ) ) );

SmtpMail.SmtpServer = System.Net.Dns.GetHostName();
SmtpMail.Send( mail );

The problem is that if C:\Test.txt has the following text:

..net
..5 w
..5
..78

then the following will be the contents of the attachment Test.txt when it
is recieved

net
5 w
5
78

This causes the PDF files that I am attaching to not display properly as
some of the lines start with .5 w

If anyone can see what I am doing wrong or knows a way around this then I
would appreciate their advice.

Thanks

Simon
Nov 15 '05 #1
3 1685

Hi Simon,

Thank you for posting in the community! My name is Jeffrey, and I will be
assisting you on this issue.

Based on my understanding, when you use SmtpMail and MailMessage to send
email which has one text file attached, your text file's content was
modified.(the "dot" was removed)
================================================== =====
I have tested your code, in my side, it works well, my text file will not
be modified.
Based on my experience, the problem may be that your proxy server or
firewall changes your attachment's content.

Have you tried other file types, such as pdf, word, etc?

I will wait for your further feedback.

================================================== ====
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #2
Hi Jeffery

Thanks for your reply.

The file that I was sending out was a pdf file and that was being modified.
When I was sending out more than one pdf file I was putting them in a zip
file. The zip files were not being altered but that might be because they
didn't have any lines starting with a dot. I will have a look at the
settings for the proxy server and the firewall and see if I can see anything
there. Failing that as a last resort I can insert a extra dot at the
beginning of any lines that begin with a dot.

thanks

Simon

""Jeffrey Tan[MSFT]"" <v-*****@online.microsoft.com> wrote in message
news:9g**************@cpmsftngxa07.phx.gbl...

Hi Simon,

Thank you for posting in the community! My name is Jeffrey, and I will be
assisting you on this issue.

Based on my understanding, when you use SmtpMail and MailMessage to send
email which has one text file attached, your text file's content was
modified.(the "dot" was removed)
================================================== =====
I have tested your code, in my side, it works well, my text file will not
be modified.
Based on my experience, the problem may be that your proxy server or
firewall changes your attachment's content.

Have you tried other file types, such as pdf, word, etc?

I will wait for your further feedback.

================================================== ====
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #3

Hi Simon,

Thanks for your feedback.

I think even you add more dots in your text file, the firewall may remove
all the dots.
I think you may workaround this through change your file's extension, such
as change your test.pdf to test.dat, so that the file content will not be
changed.

Anyway, I will wait for your feedback after checking proxy server and
firewall. I will work with you.
Thanks

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Trond A. S. Andersen | last post: by
4 posts views Thread by Trond A. S. Andersen | last post: by
6 posts views Thread by Frank | last post: by
2 posts views Thread by asnowfall | last post: by
4 posts views Thread by a | last post: by
9 posts views Thread by =?Utf-8?B?QW5kcmV3?= | last post: by
1 post views Thread by CARIGAR | last post: by
1 post views Thread by Oskars | last post: by
9 posts views Thread by bryonone | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.