473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

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 1793

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: doug.hughes | last post by:
Hi I wrote an email queuing application in ASP / CDO, which uses a database as it's source. It reads email parameters (From, To, Subject, etc.) from a database, constructs then sends mail...
1
by: Trond A. S. Andersen | last post by:
Hi all, I'm working on a project in which i need to send mail attachments in the form of Excel documents from a .NET C# application. I've written a class which creates the Excel document using...
4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
4
by: Mark Rae | last post by:
Hi, Can anyone please tell me if it's possible to pass a System.Web.Mail.MailMessage object to a ASP.NET Web Service? Maybe using XML Serialization / Deserialization? I've been asked to...
6
by: Frank | last post by:
Straightforward VB.NET 2002 code that works form both Windows and ASP.NET apps on a Windows 2000 machine, and works in the Windows app on a newly installed XP machine, but fails in the ASP.NET...
2
by: John Buell | last post by:
When I generate an html email to send via SmtpMail, it will (apparently) randomly remove a period in the filename for some image and anchor tags, but not all For example, in the email body, i may...
2
by: asnowfall | last post by:
I am trying to build System.Mail.MailMessage object out of mime encoded SMTP data. I have following questions Byte byteMailData; //mime encoded STMP data for "email with attachment" 1)...
4
by: a | last post by:
Hi I want my application uses the instance of MailMessage and SmtpMail classes to send email. How can I add a reference to the System.Web.dll assembly to use these classes? Do the SmtpMail...
9
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hi, I want to delete my email attachment after sending the email. How do I get around this issue ? I have set up a method to send email using SMTP. public bool CreateMessageWithAttachment()...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.