Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <SMTPSET.H>
Link against: imcm.lib

Class CImSmtpSettings

class CImSmtpSettings : public CImBaseEmailSettings;

Description

Run-time configuration settings for an SMTP account.

Messaging clients should use an instance of this class to specify and retrieve configuration settings that are used by the SMTP service when executing email operations.

Service settings such as the email body encoding, reply address, character set, and whether to attach a signature or vCard can be specified using this class. Storing and restoring from the message store is also supported.

To use this class to change a setting:

1) Set the current context to the SMTP service entry using CMsvStore.

2) Create an instance of CImSmtpSettings and put it on the cleanup stack.

3) Retrieve the existing settings by calling CImSmtpSettings::RestoreL().

4) Specify whether to add a vCard to outbound email by calling CImSmtpSettings::SetAddVCardToEmail(TBool).

5) Save the new settings by calling CImSmtpSettings::StoreL().

6) Pop and destroy the CImSmtpSettings instance.

Derivation

Members

Defined in CImSmtpSettings:

Inherited from CBase:

Inherited from CImBaseEmailSettings:

See also:


Construction and destruction


CImSmtpSettings()

IMPORT_C CImSmtpSettings();

Description

Allocates and creates a new CImImap4Settings object initialised to default values.


~CImSmtpSettings()

IMPORT_C virtual ~CImSmtpSettings();

Description

Destructor.

[Top]


Member functions


Reset()

IMPORT_C void Reset();

Description

Resets the settings to their default values.


EmailAlias()const

IMPORT_C const TPtrC EmailAlias() const;

Description

Retrieves the configured email alias (display name) that will be sent with outbound email.

This is normally set to the real name of the user, e.g. "John Smith". Set this value by calling CImSmtpSettings::SetEmailAliasL(const TDesC &).

Return value

const TPtrC16

The email alias (display name) if set, empty if not.


SetEmailAliasL(const TDesC &)

IMPORT_C void SetEmailAliasL(const TDesC &aEmailAlias);

Description

Specifies the configured email alias (display name) that will be sent with outbound email.

This is normally set to the real name of the user. For example, "John Smith".

Parameters

const TDesC16 &aEmailAlias

The email alias (display name).


EmailAddress()const

IMPORT_C const TPtrC EmailAddress() const;

Description

Retrieves the configured SMTP email address of the user, e.g. "[email protected]".

Return value

const TPtrC16

SMTP email address of the user if set, empty if not.


SetEmailAddressL(const TDesC &)

IMPORT_C void SetEmailAddressL(const TDesC &aEmailAddress);

Description

Specifies the SMTP email address of the user.

Parameters

const TDesC16 &aEmailAddress

SMTP email address of the user.


ReplyToAddress()const

IMPORT_C const TPtrC ReplyToAddress() const;

Description

Gets the internet email address that the user wishes replies to emails to be sent to.

This may be set to be the same as for CImSmtpSettings::EmailAddress()const, or may be set to be a different email address, e.g. "groupenquiries\@work.com".

Return value

const TPtrC16

Internet email address that the user wishes replies to emails to be sent to


SetReplyToAddressL(const TDesC &)

IMPORT_C void SetReplyToAddressL(const TDesC &aReplyToAddress);

Description

Specifies the email address that the user wishes replies to emails to be sent to. If this is not specified, replies will be sent to the address set by calling CImSmtpSettings::SetEmailAddressL(const TDesC &).

Parameters

const TDesC16 &aReplyToAddress

SMTP email address that the user wishes replies to emails to be sent to.


ReceiptAddress()const

IMPORT_C const TPtrC ReceiptAddress() const;

Description

Gets the internet email address that the user wishes receipts to be returned to.

This would normally be set to be the same as for CImSmtpSettings::ReplyToAddress()const, e.g. "groupenquiries\@work.com".

Return value

const TPtrC16

Internet email address that the user wishes receipts to be returned to.


SetReceiptAddressL(const TDesC &)

IMPORT_C void SetReceiptAddressL(const TDesC &aReceiptAddress);

Description

Specifies the SMTP email address that the user wishes email receipts to be returned to.

Parameters

const TDesC16 &aReceiptAddress

SMTP email address that the user wishes receipts to be returned to.


BodyEncoding()const

IMPORT_C TMsgOutboxBodyEncoding BodyEncoding() const;

Description

Retrieves the method of encoding email messages if the encoding is not specified when they are sent.

The default value (EMsgOutboxMIME) is set so that text parts of the message are sent as MIME multipart/alternative text/html parts, and are encoded using UTF-8.

Return value

TMsgOutboxBodyEncoding

Method of encoding.

See also:


SetBodyEncoding(TMsgOutboxBodyEncoding)

IMPORT_C void SetBodyEncoding(TMsgOutboxBodyEncoding aBodyEncoding);

Description

Specifies the default method of encoding email messages if the encoding is not specified when sent.

The default value (EMsgOutboxMIME) is set so that text parts of the message are sent as MIME multipart/alternative text/html parts, and are encoded using UTF-8.

Parameters

TMsgOutboxBodyEncoding aBodyEncoding

Default method of encoding

See also:


DefaultMsgCharSet()const

IMPORT_C const TUid DefaultMsgCharSet() const;

Description

Retrieves which character set is used to send text in MIME email messages.

The default character set is ISO-8859-1 (Latin 1). The UIDs used to identify all character sets are defined in the Character Conversion API.

Return value

const TUid

Character set identifier.


SetDefaultMsgCharSet(TUid)

IMPORT_C void SetDefaultMsgCharSet(TUid aDefaultMsgCharSet);

Description

Specifies which character set is used to send text in MIME email messages.

The default character set is ISO-8859-1 (Latin 1). The UIDs used to identify all character sets are defined in the Character Conversion API.

Parameters

TUid aDefaultMsgCharSet

Character set identifier.


AddVCardToEmail()const

IMPORT_C TBool AddVCardToEmail() const;

Description

Retrieves whether email messages will have a VCard containing the user's details from the Contacts Database when they are sent.

This is supported as an alternative method of adding contact information into email messages if the user does not wish to send signature text in their emails.

Return value

TBool

ETrue if the user's VCard is to be attached when sending.


SetAddVCardToEmail(TBool)

IMPORT_C void SetAddVCardToEmail(TBool aFlag);

Description

Specifies whether the email messages will have a VCard containing the user's details from the Contacts Database when they are sent.

Parameters

TBool aFlag

ETrue if the user's VCards will be added when the email is sent.


AddSignatureToEmail()const

IMPORT_C TBool AddSignatureToEmail() const;

Description

Retrieves whether email messages will have the user's signature text appended to the text of the messages when they are sent.

The signature is stored in the SMTP service entry as a rich text body stream.

If there is no signature body text stored in the SMTP service entry, then the email is sent with no signature. This method does not check whether the signature body text exists in the SMTP entry or not.

This method is supported as an alternative method for adding contact information into email messages if the user does not wish to send VCards in emails.

Return value

TBool

ETrue If a signature text will be appended if it axists.


SetAddSignatureToEmail(TBool)

IMPORT_C void SetAddSignatureToEmail(TBool aFlag);

Description

Specifies whether email messages will have the user's signature text appended to the text of the messages when they are sent.

The signature is stored in the SMTP service entry as a rich text body stream.

If there is no signature body text stored in the SMTP service entry, then the email is sent with no signature. This method does not check whether the signature body text exists in the SMTP entry or not.

This method is supported as an alternative method for adding contact information into email messages if the user does not wish to send VCards in emails.

Parameters

TBool aFlag

ETrue if a signature text should be attempted to be appended to outbound email.


RequestReceipts()const

IMPORT_C TBool RequestReceipts() const;

Description

Retrieves whether outbound email messages will contain a header that requests receipts to be returned to the address identified by CImSmtpSettings::ReceiptAddress()const.

If no receipt address has been set,then no receipt is requested. It is entirely up to the receiving mail client whether or not it will comply with this request.

Return value

TBool

ETrue if receipts are requested.


SetRequestReceipts(TBool)

IMPORT_C void SetRequestReceipts(TBool aFlag);

Description

Specifies whether outbound email messages will have a header added that requests a receipt from the recipient.

If no receipt address has been set,then no receipt is requested. It is entirely up to the receiving mail client whether or not it will comply with this request.

Parameters

TBool aFlag

ETrue if receipts will be requested.


SendCopyToSelf()const

IMPORT_C TImSMTPSendCopyToSelf SendCopyToSelf() const;

Description

Retrieves the setting of the option that allows the user to automatically email themselves a copy of all emails that are sent.

Return value

TImSMTPSendCopyToSelf

Option setting.

See also:


SetSendCopyToSelf(TImSMTPSendCopyToSelf)

IMPORT_C void SetSendCopyToSelf(TImSMTPSendCopyToSelf aSendCopyToSelf);

Description

Specifies the option that allows the user to automatically email themselves a copy of all emails that are sent.

Parameters

TImSMTPSendCopyToSelf aSendCopyToSelf

Option setting.

See also:


SendMessageOption()const

IMPORT_C TImSMTPSendMessageOption SendMessageOption() const;

Description

Retrieves the setting of the sending option for new email messages if it is not specified while sending.

This option is intended to be acted on by the message client. The default value is send the message immediately (ESendMessageImmediately).

Return value

TImSMTPSendMessageOption

Default sending option.

See also:


SetSendMessageOption(TImSMTPSendMessageOption)

IMPORT_C void SetSendMessageOption(TImSMTPSendMessageOption aSendMessageOption);

Description

Specifies the sending option for outbound email messages if it is not specified while sending.

The default value is to send the message immediately (ESendMessageImmediately).

Parameters

TImSMTPSendMessageOption aSendMessageOption

Default sending option.

See also:


CopyL(const CImSmtpSettings &)

IMPORT_C CImSmtpSettings& CopyL(const CImSmtpSettings &aCImSmtpSettings);

Description

Copies the configuration settings from another SMTP settings object into this object.

Parameters

const CImSmtpSettings &aCImSmtpSettings

Specifies the object to copy.

Return value

CImSmtpSettings &

This object after copying.


operator==(const CImSmtpSettings &)const

IMPORT_C TBool operator==(const CImSmtpSettings &aCImSmtpSettings) const;

Description

Equality operator.

Parameters

const CImSmtpSettings &aCImSmtpSettings

Specifies the SMTP settings object to compare with.

Return value

TBool

ETrue if the settings are the same.


LoginName()const

IMPORT_C const TPtrC8 LoginName() const;

Description

Retrieves the login user name used when SMTP authentication is enabled by calling CImSmtpSettings::SetSMTPAuth(TBool).

Return value

const TPtrC8

The login user name.


SetLoginNameL(const TDesC8 &)

IMPORT_C void SetLoginNameL(const TDesC8 &);

Description

Specifies the login user name used when SMTP authentication is enabled by calling CImSmtpSettings::SetSMTPAuth(TBool).

Parameters

const TDesC8 &

The login user name.


Password()const

IMPORT_C const TPtrC8 Password() const;

Description

Retrieves the password used when SMTP authentication is enabled by calling CImSmtpSettings::SetSMTPAuth(TBool).

Return value

const TPtrC8

The password.


SetPasswordL(const TDesC8 &)

IMPORT_C void SetPasswordL(const TDesC8 &);

Description

Specifies the password used when SMTP authentication is enabled by calling CImSmtpSettings::SetSMTPAuth(TBool).

Parameters

const TDesC8 &

The password.


SMTPAuth()const

IMPORT_C TBool SMTPAuth() const;

Description

Retrieves whether SMTP authentication will be used when sending emails. Read RFC 2554 "SMTP Service Extension for Authentication" for more details.

Return value

TBool

ETrue if SMTP authentication is enabled.


SetSMTPAuth(TBool)

IMPORT_C void SetSMTPAuth(TBool aFlag);

Description

Enables or disables SMTP authentication when sending emails. Read RFC 2554 "SMTP Service Extension for Authentication" for more details.

Parameters

TBool aFlag

ETrue to enable SMTP authentication.


InboxLoginDetails()const

IMPORT_C TBool InboxLoginDetails() const;

Description

Return value

TBool


SetInboxLoginDetails(TBool)

IMPORT_C void SetInboxLoginDetails(TBool aFlag);

Description

Parameters

TBool aFlag


ToCcIncludeLimit()const

IMPORT_C TInt ToCcIncludeLimit() const;

Description

Retrieves the setting for inclusion of original To and CC email addresses in the body text of reply and forwarded emails.

Return value

TInt

The maximum number of addresses to include in either field.


SetToCcIncludeLimitL(TInt)

IMPORT_C void SetToCcIncludeLimitL(TInt aLimit);

Description

Specifies maximum number of original To and CC addresses to include in the body header when replying-to and forwarding emails. The default (0) indicates that no addresses should be included.

Parameters

TInt aLimit

The maximum number of addresses to include in each field.


SetTlsSslDomainL(const TDesC8 &)

IMPORT_C void SetTlsSslDomainL(const TDesC8 &aDomainName);

Description

Sets the domain name to use during TLS/SSL certificate validation.

Parameters

const TDesC8 &aDomainName

Domain name


TlsSslDomain()const

IMPORT_C TPtrC8 TlsSslDomain() const;

Description

Gets the domain name used during TLS/SSL certificate validation.

Return value

TPtrC8

Domain name