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
fromEmailstringThe email address to send from.
mailOfAdminstringThe administrator's email address.
passwordstringThe email account password.
smtpServerSmtpServerDataOptional 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
fromNamestringThe sender's display name.
fromEmailstringThe email address to send from.
mailOfAdminstringThe administrator's email address.
passwordstringThe email account password.
smtpServerSmtpServerDataOptional SMTP server configuration.
Properties
FromEmail
Gets or sets the complete email address configured for sending.
public string? FromEmail { get; set; }
Property Value
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
MailOfAdmin
Gets or sets the administrator's email address for notifications.
public string? MailOfAdmin { get; set; }
Property Value
Password
Gets or sets the password for the email account.
public string? Password { get; set; }
Property Value
SmtpServerData
Gets or sets the SMTP server configuration.
public SmtpServerData SmtpServerData { get; set; }
Property Value
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
tostringRecipient email address(es), semicolon-separated for multiple.
ccstringCarbon copy email address(es), semicolon-separated for multiple.
bccstringBlind carbon copy email address(es), semicolon-separated for multiple.
replyTostringReply-to email address, or empty string to use the from address.
subjectstringEmail subject line.
bodystringEmail body content.
isBodyHtmlboolWhether the body content is HTML formatted.
attachmentsstring[]Optional file paths to attach to the email.
Returns
- string
Returns "success" on successful send, or "error: [message]" on failure.