API reference
GDSMTPClient
Reuse one SMTP session for greeting, authentication, recipients, DATA transfer, and shutdown.
Methods
hello(name: String = "localhost") -> Dictionary, Errhello_async(name: String = "localhost") -> await Dictionary, Errstart_tls(opts: Dictionary = { }) -> Dictionary, Errstart_tls_async(opts: Dictionary = { }) -> await Dictionary, Errauth(config: Dictionary) -> Dictionary, Errauth_async(config: Dictionary) -> await Dictionary, Errmail(from: String) -> Dictionary, Errmail_async(from: String) -> await Dictionary, Errrcpt(to: String) -> Dictionary, Errrcpt_async(to: String) -> await Dictionary, Errdata() -> GDSMTPDataWriter, Errdata_async() -> await GDSMTPDataWriter, Errreset() -> Dictionary, Errreset_async() -> await Dictionary, Errnoop() -> Dictionary, Errnoop_async() -> await Dictionary, Errverify(address: String) -> Dictionary, Errverify_async(address: String) -> await Dictionary, Errquit() -> Dictionary, Errquit_async() -> await Dictionary, Errclose() -> voidextension(name: String) -> Dictionarytls_state() -> Dictionary
hello
hello(name: String = "localhost") -> Dictionary, ErrIntroduce the session with EHLO or HELO.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | String | "localhost" | Name used to register or look up the corresponding entry. |
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
hello_async
hello_async(name: String = "localhost") -> await Dictionary, ErrIntroduce the session with EHLO or HELO.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | String | "localhost" | Name used to register or look up the corresponding entry. |
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
start_tls
start_tls(opts: Dictionary = { }) -> Dictionary, ErrUpgrade the existing SMTP connection to verified TLS.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
opts | Dictionary | { } | Named options for this operation. Omitted entries use their documented defaults. |
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
start_tls_async
start_tls_async(opts: Dictionary = { }) -> await Dictionary, ErrUpgrade the existing SMTP connection to verified TLS.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
opts | Dictionary | { } | Named options for this operation. Omitted entries use their documented defaults. |
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
auth
auth(config: Dictionary) -> Dictionary, ErrAuthenticate after transport policy is checked.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config | Dictionary | Required | Authentication settings including kind, user, secret and optional identity. |
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
auth_async
auth_async(config: Dictionary) -> await Dictionary, ErrAuthenticate after transport policy is checked.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
config | Dictionary | Required | Authentication settings including kind, user, secret and optional identity. |
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
mail(from: String) -> Dictionary, ErrStart one SMTP envelope.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
from | String | Required | Starting point used by the operation. |
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
mail_async
mail_async(from: String) -> await Dictionary, ErrStart one SMTP envelope.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
from | String | Required | Starting point used by the operation. |
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
rcpt
rcpt(to: String) -> Dictionary, ErrAdd one recipient to the envelope.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
to | String | Required | Destination selected by the operation. |
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
rcpt_async
rcpt_async(to: String) -> await Dictionary, ErrAdd one recipient to the envelope.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
to | String | Required | Destination selected by the operation. |
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
data
data() -> GDSMTPDataWriter, ErrEnter DATA mode and return a typed writer.
Parameters
No parameters.
Return value
GDSMTPDataWriter, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
data_async
data_async() -> await GDSMTPDataWriter, ErrEnter DATA mode and return a typed writer.
Parameters
No parameters.
Return value
await GDSMTPDataWriter, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
reset
reset() -> Dictionary, ErrReset the active envelope.
Parameters
No parameters.
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
reset_async
reset_async() -> await Dictionary, ErrReset the active envelope.
Parameters
No parameters.
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
noop
noop() -> Dictionary, ErrCheck whether the SMTP peer responds.
Parameters
No parameters.
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
noop_async
noop_async() -> await Dictionary, ErrCheck whether the SMTP peer responds.
Parameters
No parameters.
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
verify
verify(address: String) -> Dictionary, ErrAsk the peer about one address.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
address | String | Required | Mailbox address submitted to the SMTP VRFY command. |
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
verify_async
verify_async(address: String) -> await Dictionary, ErrAsk the peer about one address.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
address | String | Required | Mailbox address submitted to the SMTP VRFY command. |
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
quit
quit() -> Dictionary, ErrEnd the SMTP session and close its transport.
Parameters
No parameters.
Return value
Dictionary, Err
Suspends only the calling routine until the operation completes. No explicit await is needed.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
quit_async
quit_async() -> await Dictionary, ErrEnd the SMTP session and close its transport.
Parameters
No parameters.
Return value
await Dictionary, Err
Returns a Signal. Use await to receive the completion value shown in the signature.
Errors
The result carries a value and an Err. Check the error before using the value; a failure may retain partial progress. In a function returning value, Err, use ? to propagate failure to the caller. The ! operator terminates the program on failure; in serve it fails the current handler.
close
close() -> voidRelease the SMTP transport immediately.
Parameters
No parameters.
Return value
void
No value is returned.
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
extension
extension(name: String) -> DictionaryRead one advertised SMTP extension.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | String | Required | Name used to register or look up the corresponding entry. |
Return value
Dictionary
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.
tls_state
tls_state() -> DictionaryRead the connection's TLS negotiation state.
Parameters
No parameters.
Return value
Dictionary
Errors
This call has no Err return slot. Its return type and documented sentinel values determine how to inspect the result.