BSMTP
Identità
Namespace:
B.BMailAssembly:
BFrameworkTipo: class
Interfacce:
IDisposableSorgente API: versione
5.0.0
Scopo
Invia email tramite SMTP .NET o tramite le stored procedure B-Arts per SQL Server Database Mail. Gestisce destinatari, copie, allegati, invio asincrono ed errori raccolti in ExceptionList.
Dichiarazione
public class BSMTP : IDisposable
Costruttori
BSMTP(BSenderMailConfig senderConfig)BSMTP(string smtpServer, int smtpPort, string smtpUser = "", string smtpPwd = "", bool ssl = false)
Proprietà
| Proprietà | Tipo | Accesso |
|---|---|---|
AliasMittente |
string |
get/set |
Allegati |
List<string> |
get/set |
AsyncCall |
bool |
get/set |
BCc |
List<string> |
get/set |
Body |
string |
get/set |
Cc |
List<string> |
get/set |
Cnn |
IBConnection? |
get/set |
Destinatari |
List<string> |
get/set |
ExceptionList |
List<Exception> |
get/set |
MailItem_ID |
int |
get/set |
mailSent |
bool |
get/set |
Oggetto |
string |
get/set |
ReplyTo |
string |
get/set |
SenderMailConfig |
BSenderMailConfig |
get/set |
SMTP |
SmtpClient |
get/set |
Metodi
void ActiveDBMail(bool enable = true)void AnnullaInvioEmailNET()bool CreaProfiloDBMail()void Dispose()bool EliminaProfiloDBMail()DataTable? GetProfiloDBMail()bool InviaMail(string destinatario = "", string oggetto = "", string body = "", string replyTo = "", string aliasMittente = "", string cc = "", string bcc = "")bool StateDBMail()
Comportamento essenziale
Le liste di indirizzi ricevute come stringa sono separate dal carattere
;.eNETMailusaUsernamecome indirizzo mittente e applicaSSL, username e password al client SMTP.Il corpo viene prodotto come HTML e i terminatori di riga vengono convertiti in
<br />.Gli allegati inesistenti vengono ignorati e registrati in
ExceptionList.eSQLSERVERrichiedeCnne le stored procedure B-Arts dedicate a Database Mail.eCDOMicrosoftrestituisce semprefalseperché non è implementato.L'istanza possiede risorse SMTP: usare
usingoppure chiamareDispose().
Esempi
Consultare BSMTP - Esempi.
