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:
00663441
Views:
19
>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.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform