Class Mail
- Namespace
- PHCLibrary
- Assembly
- PHCLibrary.dll
public class Mail
- Inheritance
-
Mail
Constructors
Mail()
In this way the class outside the dll can only be used with Inherits, but inside it can be used with New
protected Mail()
Properties
SendThroughCompany
public bool SendThroughCompany { get; set; }
Property Value
SmtpClient
public string SmtpClient { get; set; }
Property Value
SmtpPort
public short SmtpPort { get; set; }
Property Value
SmtpPwd
public string SmtpPwd { get; set; }
Property Value
SmtpSSL
public bool SmtpSSL { get; set; }
Property Value
SmtpUser
public string SmtpUser { get; set; }
Property Value
mailSender
public SmtpClient mailSender { get; }
Property Value
Methods
IsValidMail(string)
Valida se um endereço/conjunto de endereços são válidos
public static bool IsValidMail(string emailAddresses)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
emailAddresses |
string | Indica a lista de endereços de e-mail a validar, se forem vários devem vir separados por ";" |
Returns
- bool
True se todos os endereços forem válidos, False caso contrário
isValidSenderMailAdress(string)
Valida se um endereço de um remetente é valido. Este endereço pode ser algo do género "Zé Manel «zemanel@xpto.pt»"
public static bool isValidSenderMailAdress(string emailAddress)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
emailAddress |
string | Endereço de e-mail a validar, do remetente |
Returns
Send(EMailMessage)
public bool Send(EMailMessage email)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
email |
EMailMessage |
Returns
send(string, string, string, string, string)
Envio de e-mail em formato standard e em formato html
public bool send(string companylabel, string from, string recepient, string subject, string body)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
companylabel |
string | |
from |
string | |
recepient |
string | |
subject |
string | |
body |
string |
Returns
send(string, string, string, string, string, bool, string, string, List<FileAttachment>, object, List<string>, string, bool, object, bool)
Envio de e-mail com as opcoes completas
public virtual bool send(string companylabel, string from, string recepients, string subject, string body, bool isBodyHtml, string CC, string bcc, List<FileAttachment> attachmentCompleteFileNames = null, object otherInfo = null, List<string> linkedResourcesCompleteFileNames = null, string fromName = "", bool forceFrom = false, object smtpData = null, bool customizedFrom = false)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
companylabel |
string | |
from |
string | |
recepients |
string | |
subject |
string | |
body |
string | |
isBodyHtml |
bool | |
CC |
string | |
bcc |
string | |
attachmentCompleteFileNames |
List<FileAttachment> | |
otherInfo |
object | |
linkedResourcesCompleteFileNames |
List<string> | |
fromName |
string | |
forceFrom |
bool | |
smtpData |
object | |
customizedFrom |
bool |
Returns
sendFrom(string, string, string, string, string)
Envio de e-mail em formato standard e em formato html e com reforço do remetente (utilizado para e-mails diretos. Não coloca a companhia e coloca do from direto)
public bool sendFrom(string companylabel, string from, string recepient, string subject, string body)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
companylabel |
string | |
from |
string | |
recepient |
string | |
subject |
string | |
body |
string |
Returns
sendFrom(string, string, string, string, string, bool, string, string, List<FileAttachment>, object, List<string>, string, string)
Envio de e-mail com as opcoes completas e com reforço do remetente (utilizado apenas para mails do Service) this function shouldnt have trial limit validation, because it is used for log send
public bool sendFrom(string companylabel, string from, string recepients, string subject, string body, bool isBodyHtml, string CC, string bcc, List<FileAttachment> attachmentCompleteFileNames = null, object otherInfo = null, List<string> linkedResourcesCompleteFileNames = null, string mailToReply = "", string fromName = "")
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
companylabel |
string | |
from |
string | |
recepients |
string | |
subject |
string | |
body |
string | |
isBodyHtml |
bool | |
CC |
string | |
bcc |
string | |
attachmentCompleteFileNames |
List<FileAttachment> | |
otherInfo |
object | |
linkedResourcesCompleteFileNames |
List<string> | |
mailToReply |
string | |
fromName |
string |
Returns
validateSMTPSettings(string, string, string, string, string, string, int, bool)
Valida as definições de smtp passadas por parametro.
public static SmtpStatusCode validateSMTPSettings(string email, string subject, string body, string smtpServer, string smtpUser, string smtpPass, int smtpPort, bool smtpSSL)
Parameters
| Nome | Tipo | Descrição |
|---|---|---|
email |
string | |
subject |
string | |
body |
string | |
smtpServer |
string | |
smtpUser |
string | |
smtpPass |
string | |
smtpPort |
int | |
smtpSSL |
bool |
Returns
Events
SendCompleted
public event Mail.SendCompletedEventHandler SendCompleted