B-Arts DocumentationIndice generale

BSMTP

Identità

  • Namespace: B.BMail

  • Assembly: BFramework

  • Tipo: class

  • Interfacce: IDisposable

  • Sorgente 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 ;.

  • eNETMail usa Username come indirizzo mittente e applica SSL, 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.

  • eSQLSERVER richiede Cnn e le stored procedure B-Arts dedicate a Database Mail.

  • eCDOMicrosoft restituisce sempre false perché non è implementato.

  • L'istanza possiede risorse SMTP: usare using oppure chiamare Dispose().

Esempi

Consultare BSMTP - Esempi.