Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Components / June 2008



Tip: Looking for answers? Try searching our database.

Bare Linefeeds in SMTP Messages

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
X. Zhang - 19 Jun 2008 16:49 GMT
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 - 20 Jun 2008 01:42 GMT
> Set iBp1 = iBps.AddBodyPart  ' Add a BodyPart object to the hierarchy
> Set iBp2 = iBp1.AddBodyPart
[quoted text clipped - 9 lines]
> 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 - 20 Jun 2008 15:17 GMT
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>

> > Set iBp1 = iBps.AddBodyPart  ' Add a BodyPart object to the hierarchy
> > Set iBp2 = iBp1.AddBodyPart
[quoted text clipped - 26 lines]
>
> But if you see something else, tell us/show us.
Old Pedant - 30 Jun 2008 23:53 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.