Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Thu, 19 Jun 2008 08:49:01 -0700,    group: microsoft.public.inetserver.asp.components        back       


Bare Linefeeds in SMTP Messages   
I don't know if this is the right forum. I was trying to send out email using 
CDO.Message. (Windows 2003 Server with IIS 6) But some of our clients could 
not receive our emails. I checked the SMTP server log, and found that
    "OutboundConnectionResponse SMTPSVC1 S79349 - 25 - - 
451+See+http://pobox.com/~djb/docs/smtplf.html. 0 0 47 0 593 SMTP - - - -"

Then I did some search and found the following articles 
    1) Bare LFs in SMTP (http://cr.yp.to/docs/smtplf.html);
    2) Bare Linefeeds in SMTP Messages Cause "The Connection Was Dropped By 
The Remote Host" Errors When Using Microsoft IIS 6 SMTP Service 
(http://www.dylanbeattie.net/docs/iis6_bare_linefeed.html)

It seems that explains my problem. The solution is replacing "\n" to "\r\n". 
However, my problem is, I use HTML format to compose mail body, and there are 
"<br>"s instead of "\n"s. And the mail is sent by the following code

...
Set iBp1 = iBps.AddBodyPart  ' Add a BodyPart object to the hierarchy
Set iBp2 = iBp1.AddBodyPart
With iBp2.Fields
	.Item("urn:schemas:mailheader:content-type")              = "text/html"
	.Item("urn:schemas:mailheader:content-transfer-encoding") = 
"quoted-printable"
	.Item("urn:schemas:mailheader:expires")                   = datExpiry
	.Update
End With
Set Stm = iBp2.GetDecodedContentStream
Stm.WriteText se_strBody
Stm.Flush
... 

How can I solve the problem? Thanks.
date: Thu, 19 Jun 2008 08:49:01 -0700   author:   X. Zhang

RE: Bare Linefeeds in SMTP Messages   
> Set iBp1 = iBps.AddBodyPart  ' Add a BodyPart object to the hierarchy
> Set iBp2 = iBp1.AddBodyPart
> With iBp2.Fields
> 	.Item("urn:schemas:mailheader:content-type")              = "text/html"
> 	.Item("urn:schemas:mailheader:content-transfer-encoding") = 
> "quoted-printable"
> 	.Item("urn:schemas:mailheader:expires")                   = datExpiry
> 	.Update
> End With
> Set Stm = iBp2.GetDecodedContentStream
> Stm.WriteText se_strBody
> Stm.Flush
> ... 

So the problem is in se_strBody ???  That is, *IT* contains the <br> tags 
but no linefeeds??

Can you just do a 
    Response.Write se_strBody
and then use VIEW==>>SOURCE in your browser to look at what is *actually* in 
there??

It may be that what you really have is
     text text<br>[LF]text text<br>[LF}...
or something similar.

If so, you could simply do
    se_strBody = Replace( se_strBody, vbLF, vbCRLF )

But if you see something else, tell us/show us.
date: Thu, 19 Jun 2008 17:42:00 -0700   author:   Old Pedant

RE: Bare Linefeeds in SMTP Messages   
Thanks for your reply, Old Pedant.
The following is what I got according to your suggestion. But I did not find 
any [LF].

<br><html><head><style type="text/css">body, table{font-size: 10px; 
font-family: verdana, tahoma, ms sans serif, sans 
serif}</STYLE></head><body>Dear <b>Jon Haynes</b>,<br><br>This is a test 
message from projectweb<br>
by xidong zhang<br>
please ignore it if you happens to get this one.<br>
sorry for the interruption.<br><br><b>The files listed below have been added 
to folder<br><a 
href='http://projectweb.giffels.com/main.asp?hidProjectID=50816'>» 2 
INTERNATIONAL BLVD » REVIT</a></b><br><br><a 
href='http://projectweb.giffels.com/download-help.pdf'>Click here to learn 
how to view or download the files.</a><br><br><table 
cellpadding=2><tr><td><b>Name</b></td><td><b>Description</b></td><td><b>Rev</b></td><td><b>Size 
KB</b></td></tr><tr><td><b>a.txt</b></td><td>a.txt</td><td 
align=right></td><td align=right>0.01</td></tr></table><br><font size=1>This 
message has been sent to the following user(s):<br><br>Jon Haynes - Norr 
Limited<br><br></font></body></html>


"Old Pedant" wrote:

> > Set iBp1 = iBps.AddBodyPart  ' Add a BodyPart object to the hierarchy
> > Set iBp2 = iBp1.AddBodyPart
> > With iBp2.Fields
> > 	.Item("urn:schemas:mailheader:content-type")              = "text/html"
> > 	.Item("urn:schemas:mailheader:content-transfer-encoding") = 
> > "quoted-printable"
> > 	.Item("urn:schemas:mailheader:expires")                   = datExpiry
> > 	.Update
> > End With
> > Set Stm = iBp2.GetDecodedContentStream
> > Stm.WriteText se_strBody
> > Stm.Flush
> > ... 
> 
> So the problem is in se_strBody ???  That is, *IT* contains the <br> tags 
> but no linefeeds??
> 
> Can you just do a 
>     Response.Write se_strBody
> and then use VIEW==>>SOURCE in your browser to look at what is *actually* in 
> there??
> 
> It may be that what you really have is
>      text text<br>[LF]text text<br>[LF}...
> or something similar.
> 
> If so, you could simply do
>     se_strBody = Replace( se_strBody, vbLF, vbCRLF )
> 
> But if you see something else, tell us/show us.
date: Fri, 20 Jun 2008 07:17:01 -0700   author:   X. Zhang

RE: Bare Linefeeds in SMTP Messages   
Did you ever figure this out?

Sorry, I missed your reply.

The [LF] notation is meant to indicate a Line Feed in the middle of the 
text.  You won't *see* [LF], you'll just see a line break when you view the 
output with (say) Notepad.
date: Mon, 30 Jun 2008 15:53:04 -0700   author:   Old Pedant

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us