Source: factory.core/ObjWebMail.py
Connection pool for SMTP connections with automatic lifecycle management.
Maintains a pool of reusable SMTP connections to improve performance
for bulk email sending. Connections are validated before reuse and
automatically cleaned up when expired.
| Method | Signature | Description |
|---|---|---|
| get_connection | get_connection(host: str, port: int, user: str, password: str, helo: str) -> Optional[Tuple[Any, float]] |
Get a connection from pool or return None if no valid connection. |
| return_connection | return_connection(host: str, port: int, user: str, conn: Any) -> None |
Return a connection to the pool for reuse. |
| close_all | close_all() -> None |
Close all connections in the pool. |
| Method | Signature | Description |
|---|---|---|
| uuid | uuid(*args) |
|
| set_remote_connection | set_remote_connection(remote_connection: str = '') -> None |
|
| set_channel | set_channel(Channel: str = '') -> None |
|
| validate_email | validate_email(email_address: str, check_dns: bool = True) -> Tuple[bool, str] |
Comprehensive email validation with format and DNS checks. |
| shutdown | shutdown(wait: bool = True) -> None |
Gracefully shutdown the email service. |
| send | send(from_address: str, to_address: str, message) -> str |
|
| attach_file | attach_file(path: str, file_name: str, force_main: str = '') -> MIMEBase |
Attaches a file to an email message with automatic MIME type detection. |
| send_text | send_text(from_address: str, to_address: str, subject: str, message: str, guid: str = '') -> None |
|
| envelope | envelope(html_content: str) -> str |
|
| send_image | send_image(from_address: str, to_address: str, subject: str, image_file: str) -> None |
Sends an email with a single image attachment. |
| send_file | send_file(from_address: str, to_address: str, subject: str, data_dir: str = '', data_file: str = '', message_body: str = '') -> None |
Sends an email with optional file attachment and HTML body. |
| send_report | send_report(to_address: str, subject: str, html_body: str, from_address: str = '', attachments: list = [], guid: str = '', inline_images: list = []) -> str |
Send an HTML email with optional file attachments. |
| send_html | send_html(from_address: str, to_address: str, subject: str, message: str, binary_files: list = [], guid: str = '') -> str |
Thin wrapper around send_report for backward compatibility. |
| recieve_image | recieve_image(mime_part: MIMEBase) -> str |
Placeholder for image receiving functionality (not implemented). |
| process_mail | process_mail(message_object: email.message.Message, message_number: int) -> None |
Processes a received email message and extracts payload. |
| scan_mail | scan_mail() -> str |
Scans POP3 mailbox and processes all messages. |
Displays the email credentials for a given remote connection.
Sends a test email.