Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bare Linefeeds in SMTP Messages

132 views
Skip to first unread message

X. Zhang

unread,
Jun 19, 2008, 11:49:01 AM6/19/08
to
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.

Old Pedant

unread,
Jun 19, 2008, 8:42:00 PM6/19/08
to
> 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.

X. Zhang

unread,
Jun 20, 2008, 10:17:01 AM6/20/08
to
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

unread,
Jun 30, 2008, 6:53:04 PM6/30/08
to
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.


0 new messages