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.
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.
<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>
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.