Table of Contents

Class GoogleAppsMailbox

Namespace
SunamoMail
Assembly
SunamoMail.dll

Google Apps mailbox for sending emails. Working: saves sent messages to outbox.

public class GoogleAppsMailbox
Inheritance
GoogleAppsMailbox
Inherited Members
Extension Methods

Constructors

GoogleAppsMailbox()

Initializes a new instance for sending from noreply@sunamo.cz.

public GoogleAppsMailbox()

GoogleAppsMailbox(string, string, string, SmtpServerData?)

Initializes a new instance with the specified email configuration.

public GoogleAppsMailbox(string fromEmail, string mailOfAdmin, string password, SmtpServerData? smtpServer = null)

Parameters

fromEmail string

The email address to send from.

mailOfAdmin string

The administrator's email address.

password string

The email account password.

smtpServer SmtpServerData

Optional SMTP server configuration.

GoogleAppsMailbox(string, string, string, string, SmtpServerData?)

Initializes a new instance with full email configuration. Can be null, used to send mails to webmaster.

public GoogleAppsMailbox(string fromName, string fromEmail, string mailOfAdmin, string password, SmtpServerData? smtpServer = null)

Parameters

fromName string

The sender's display name.

fromEmail string

The email address to send from.

mailOfAdmin string

The administrator's email address.

password string

The email account password.

smtpServer SmtpServerData

Optional SMTP server configuration.

Properties

FromEmail

Gets or sets the complete email address configured for sending.

public string? FromEmail { get; set; }

Property Value

string

FromName

Gets or sets the sender name that appears to recipients (does not need to be an email address).

public string? FromName { get; set; }

Property Value

string

MailOfAdmin

Gets or sets the administrator's email address for notifications.

public string? MailOfAdmin { get; set; }

Property Value

string

Password

Gets or sets the password for the email account.

public string? Password { get; set; }

Property Value

string

SmtpServerData

Gets or sets the SMTP server configuration.

public SmtpServerData SmtpServerData { get; set; }

Property Value

SmtpServerData

Methods

SendEmail(string, string, string, string, string, string, bool, params string[])

Sends an email message. Returns either "success" or a message starting with "error:". Multiple addresses can be specified in to, cc, bcc separated by semicolons. Set replyTo to empty string to use the from address as reply-to. Use empty string for unused parameters, not null.

public string SendEmail(string to, string cc, string bcc, string replyTo, string subject, string body, bool isBodyHtml, params string[] attachments)

Parameters

to string

Recipient email address(es), semicolon-separated for multiple.

cc string

Carbon copy email address(es), semicolon-separated for multiple.

bcc string

Blind carbon copy email address(es), semicolon-separated for multiple.

replyTo string

Reply-to email address, or empty string to use the from address.

subject string

Email subject line.

body string

Email body content.

isBodyHtml bool

Whether the body content is HTML formatted.

attachments string[]

Optional file paths to attach to the email.

Returns

string

Returns "success" on successful send, or "error: [message]" on failure.