Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SmtpMail.Send messages get truncated
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00663316
Message ID:
00663658
Views:
21
Thanks for the reply.

My lines already contains CRLF. So it doesn't help.

Also, I have done some test with RFC 821 (that also use SMTP) method and the same message is sent correctly.

See http://www.codeproject.com/csharp/sendmailcsharp.asp for details on the RFC 821 method.

>>In VB.Net, I use this small method:
>>
>> Private Sub SendMail(ByVal pstrSubject As String, ByRef pstrMessage As String)
>> Dim ms As New MailMessage()
>>
>> ms.From = "from@from.com"
>> ms.To = "to@to.com"
>> ms.Subject = pstrSubject
>> ms.Body = pstrMessage
>> ms.BodyFormat = MailFormat.Text
>> SmtpMail.SmtpServer = "my.server.com"
>> SmtpMail.Send(ms)
>> 'MsgBox("pstrMessage=" + Len(pstrMessage).ToString + vbCrLf + "ms.Body=" + Len(ms.Body).ToString)
>> End Sub
>>
>>My message is about 10,000 characters long and is getting truncated around 3300 characters.
>>
>>Why?
>
>The SMTP spec only allows for lines up to around 1000 characters per line. Most SMTP servers allow for longer lines (as you've found out), but the exact amount depends on the implementation (that is, you can't count on always being able to get 3000 characters, only 1000). If you embed a CRLF before that 1000 character limit, that should fix your problem.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform