Class EmailSettings
Contains the email account settings such as host, email address, name.
Inheritance
Namespace: FastReport.Export.Email
Assembly: FastReport.dll
Syntax
[TypeConverter(typeof(FRExpandableObjectConverter))]
public class EmailSettings
Remarks
You have to set up at least the Address and Host properties. If your host requires authentication, provide the UserName and Password properties as well.
Set UseMAPI property to true if you want to use default email client such as Outlook to send an email. In this case, all other properties will be ignored.
Constructors
EmailSettings()
Initializes a new instance of the EmailSettings class with default settings.
Declaration
public EmailSettings()
Properties
Address
Gets or sets the sender's email address.
Declaration
public string Address { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property contains your email address (for example, "john@site.com").
AllowUI
Gets or sets a value that determines whether the account setting page in the "Send Email" window is enabled.
Declaration
public bool AllowUI { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
EnableSSL
Gets or sets a value that determines whether to enable the SSL protocol.
Declaration
public bool EnableSSL { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Host
Gets or sets the SMTP host name or IP address.
Declaration
public string Host { get; set; }
Property Value
Type | Description |
---|---|
System.String |
MessageTemplate
Gets or sets the template that will be used to create a new message.
Declaration
public string MessageTemplate { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Name
Gets or sets the sender's name.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property contains your name (for example, "John Smith").
Password
Gets or sets the password.
Declaration
public string Password { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Port
Gets or sets the SMTP port.
Declaration
public int Port { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Remarks
The default value for this property is 25.
UseMAPI
Gets or sets a value that determines whether to use MAPI instead of SMTP when sending an email.
Declaration
public bool UseMAPI { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UserName
Gets or sets the user name.
Declaration
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Methods
Assign(EmailSettings)
Copies email settings from another source.
Declaration
public void Assign(EmailSettings source)
Parameters
Type | Name | Description |
---|---|---|
EmailSettings | source | Source to copy settings from. |