Undesireable line break

Mar 8, 2010 at 2:36 PM

Hi,

 

I use that code to send emails via smtp : 

 

SmtpMessage mg = new SmtpMessage();
            mg.From = from;
            mg.To.Add(new Higuchi.Net.Mail.MailAddress(to));
            mg.Cc.Add(new Higuchi.Net.Mail.MailAddress(from)); // Add also the source address to the mail
            mg.Date = DateTime.Now.ToUniversalTime();
            mg["Mime-Version"] = "1.0";
            mg["Content-type"] = "text/html";
            mg.Subject = subject;
            mg.BodyText = body;

            SmtpClient cl = new SmtpClient();
            cl.HostName = "localhost";
            cl.ServerName = _smtp_host;
            cl.Port = _smtp_port;
            cl.AuthenticateMode = SmtpAuthenticateMode.Plain;
            cl.Ssl = false;
            SendMailResult rs = cl.SendMail(mg);

body content in the code :

<html><headers></headers><body>2100033611999;10.249.237.214;<br/>
2100033611999;10.249.237.215;<br/>
2100033611999;10.249.237.216;<br/>
2100033611999;10.249.237.217;<br/>
2100033611999;10.249.237.218;<br/>
2100033611999;10.249.237.219;<br/>
2100033611999;10.249.237.220;<br/>
2100033611999;10.249.237.221;<br/>
2100033611999;10.249.237.222;<br/>
2100033611999;10.249.237.223;<br/>

The result on that text when looking the source in outlook :

<html><headers></headers><body>2100033611999;10.249.237.214;<br/>
210003361
1999;10.249.237.215;<br/>
2100033611999;10.249.237.216;<br/>
2100033611999
;10.249.237.217;<br/>
2100033611999;10.249.237.218;<br/>
2100033611999;10.
249.237.219;<br/>
2100033611999;10.249.237.220;<br/>
2100033611999;10.249.
237.221;<br/>
2100033611999;10.249.237.222;<br/>
2100033611999;10.249.237.
223;<br/>

This create some undeisreable spaces in outlook...

Do you know how avoid that ?

Thanks in advnace

 

Coordinator
Mar 12, 2010 at 6:07 AM

Ok.I'll check this issue.
Please wait for a few days.

Mar 15, 2010 at 3:43 PM
thanks !

2010/3/12 higty <notifications@codeplex.com>

From: higty

Ok.I'll check this issue.
Please wait for a few days.

Read the full discussion online.

To add a post to this discussion, reply to this email (csharpmail@discussions.codeplex.com)

To start a new discussion for this project, email csharpmail@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Mar 16, 2010 at 2:41 PM

You can avoid this issue to set property as below
-----------------------------------------------------
SmtpMessage mg = new SmtpMessage();
mg.HeaderEncoding = Encoding.GetEncoding("iso-2022-jp");
mg.HeaderTransferEncoding = TransferEncoding.Base64;
mg.ContentEncoding = Encoding.GetEncoding("iso-2022-jp");
mg.ContentTransferEncoding = TransferEncoding.Base64;

Mail data must be include line break with 78 chars by specification.
So my library insert line break for each 76 chars.
I'll have a time to resolve this issue.

Thank you.

 

Coordinator
Mar 16, 2010 at 3:52 PM

I complete to modify this issue.
If SmtpMessage.ContentTransferEncoding is SevenBit, line break is not added to original text data.

You can get this modified library now available.
Please check it out!!!

Mar 16, 2010 at 6:15 PM
Thanks for your excellent work !
It is solved now !

BEst regards

2010/3/16 higty <notifications@codeplex.com>

From: higty

I complete to modify this issue.
If SmtpMessage.ContentTransferEncoding is SevenBit, line break is not added to original text data.

You can get this modified library now available.
Please check it out!!!

Read the full discussion online.

To add a post to this discussion, reply to this email (csharpmail@discussions.codeplex.com)

To start a new discussion for this project, email csharpmail@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com