473,765 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.co m";
mail.Subject = "Where did the . go?";
mail.Body = "Test";
mail.BodyFormat = MailFormat.Text ;
mail.Attachment s.Add( ( new MailAttachment( "C:\\Test.t xt" ) ) );

SmtpMail.SmtpSe rver = 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 1818

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.mi crosoft.com> wrote in message
news:9g******** ******@cpmsftng xa07.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
2258
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 messages. It also stores attachments in a database binary field and programatically attaches them to the mail message. With CDO, a call to Message.Attachments.Add returns a message body
1
8238
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 the automation features provided by the Excel.Application component. The Excel workbooks/documents are stored locally before I call my SendExcelDocument() method in order to attatch each document to an instance of
4
8674
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 spreadsheet attachment per message, seems to be causing som kind of corruption of the attachment, while several spreadsheets per works just fine. Consider the following three snippets of C# code:
4
7776
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 investigate the possibility of building a front-end web page which captures MailMessage properties such To, From Subject, Attachments etc, builds a MailMessage object, passes the MailMessage object to a web service, the web service then sends the message...
6
2546
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 code on XP. The unhandled exception is "COMException: The 'SendUsing' configuration value is invalid." If I handle the exception, the exception's Message is "Could not access 'CDO.Message' object." The essence of the code is:
2
1261
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 have an image <img border="0" src="http://servername/filename.gif" But it will be received in Outlook as <img border="0" src="http://servername/filenamegif" NOTE THE MISSING PERIOD IN THE FILENAME The same thing can occur for an anchor tag...
2
3100
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) MailMessage.Body = Convert(byteMailData); If I do the above, will MailMessage object extract the Message BODY, Message HEADER and Attachments automatically.
4
8048
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 include the SMTP server, or it just uses the SMTP server of the PC? Thanks
9
4932
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() { MailMessage message = new MailMessage(); ....
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9959
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.