PowerTCP Mail for .NET
AutoSize Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > Smtp Class : AutoSize Property




Gets or sets a value indicating if the server will be asked if the message is too large before sending.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Behavior")>
<DescriptionAttribute("Checks the message size before sending")>
<DefaultValueAttribute()>
Public Property AutoSize As Boolean
Visual Basic (Usage)Copy Code
Dim instance As Smtp
Dim value As Boolean
 
instance.AutoSize = value
 
value = instance.AutoSize
C# 
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Checks the message size before sending")]
[DefaultValueAttribute()]
public bool AutoSize {get; set;}
Managed Extensions for C++ 
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Checks the message size before sending")]
[DefaultValueAttribute()]
public: __property bool get_AutoSize();
public: __property void set_AutoSize( 
   bool value
);
C++/CLI 
[CategoryAttribute("Behavior")]
[DescriptionAttribute("Checks the message size before sending")]
[DefaultValueAttribute()]
public:
property bool AutoSize {
   bool get();
   void set (    bool value);
}

Property Value

true if the server should be asked if the message is too large before sending, false otherwise. Defaults to true.

Example

The following example demonstrates properties of the Smtp component.
Visual BasicCopy Code
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.

' Don't ask the server if the message is too large.
Smtp1.AutoSize = False

' Only wait 10 seconds for a response
Smtp1.Timeout = 10000

' Send a message
Smtp1.Server = "mail.test.com"
Smtp1.Send("you@test.com", "me@test.com", "test", "test message"
C#Copy Code
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.

// Don't ask the server if the message is too large.
smtp1.AutoSize = false;

// Only wait 10 seconds for a response
smtp1.Timeout = 10000;

// Send a message
smtp1.Server = "mail.test.com";
smtp1.Send("you@test.com", "me@test.com", "test", "test message");

Remarks

The advent of MIME, which introduced the transfer of greater amounts of non-ASCII files, resulted in much larger data load for SMTP servers. The SIZE command was introduced as a way for a server to announce the maximum file size it would accept and for a client to announce the size of data it is about to send. When a client announces the size of the data, the server then has an opportunity to accept or reject the data. If the SMTP server supports the SIZE command, Smtp.AutoSize controls whether or not this announcement is made.

If you are sending mail using a server that supports the SIZE command, set this value to false to keep the client from announcing the size of the data that will be sent.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.