UiPath Documentation
uipath-cli
latest
false
UiPath CLI 用户指南
重要 :
请注意,此内容已使用机器翻译进行了本地化。 新发布内容的本地化可能需要 1-2 周的时间才能完成。

uip 管理员 smtp

"uip admin smtp" 的语法和选项,用于管理组织的出站 SMTP 电子邮件配置。

uip admin smtp 读取、更新、删除并测试组织的出站 SMTP 电子邮件配置,即 UiPath 用于发送通知、邀请和警示的邮件服务器。

大纲​

uip admin smtp get
uip admin smtp update [--host <host>] [--port <port>] [--username <username>] [--password <password>] [--domain <domain>] [--enable-ssl true|false] [--use-default-credentials true|false] [--from-address <email>] [--from-display-name <name>] [--connection-timeout <ms>]
uip admin smtp delete
uip admin smtp test --recipient <email> [same options as update]
uip admin smtp get
uip admin smtp update [--host <host>] [--port <port>] [--username <username>] [--password <password>] [--domain <domain>] [--enable-ssl true|false] [--use-default-credentials true|false] [--from-address <email>] [--from-display-name <name>] [--connection-timeout <ms>]
uip admin smtp delete
uip admin smtp test --recipient <email> [same options as update]

概念​

  • 设置底层存储为单独的键/值对( Email.Smtp.Host 、 Email.Smtp.Port等),但 CLI 将它们显示为一个平面设置对象。
  • 密码为只写密码。smtp get 永远不会返回该值 — 服务器返回的是掩码密码的 SMTP 设置,因此重新读取该值并在更新时重新发送,会静默损坏实际值。仅当您显式传递 smtp update 时,--password 才会写入密码。
  • update合并,但不会替换。它会读取现有设置,覆盖您传递的字段,并将并集写回——因为服务器要求相关键(主机、端口、发件人地址)一起存在于一个请求中。如果不传递任何字段,则客户端将失败 ("No SMTP fields to update")。
  • --port和--connection-timeout是范围验证的客户端— 端口必须是 1–65535 的整数;连接超时必须是 1–300000(毫秒)的整数。超出范围的值在任何网络调用之前都会失败。
  • test可以验证配置而不保存它。将 SMTP 选项直接传递给 test,以便在无需保留的情况下进行尝试;请省略这些操作,以测试已保存的配置。如果传递了任何自定义 SMTP 选项,但未传递 --password,并且 --use-default-credentials 不是 true,则命令客户端将失败 — 保存的密码已在服务器端加密,无法在临时测试中重复使用。当您传递部分自定义选项时,系统会将其合并到已保存的配置中(例如单独使用 --host 仍仍使用已保存的 from-address)。

uip admin smtp 获取​

获取组织当前的 SMTP 设置。永远不会返回密码值。

示例​

uip admin smtp get
uip admin smtp get

数据形状(--输出 json)​

{
  "Code": "SmtpSettings",
  "Data": {
    "host": "smtp.example.com",
    "port": "587",
    "userName": "noreply@example.com",
    "enableSsl": "True",
    "fromAddress": "noreply@example.com",
    "fromDisplayName": "UiPath Platform"
  }
}
{
  "Code": "SmtpSettings",
  "Data": {
    "host": "smtp.example.com",
    "port": "587",
    "userName": "noreply@example.com",
    "enableSsl": "True",
    "fromAddress": "noreply@example.com",
    "fromDisplayName": "UiPath Platform"
  }
}

uip admin smtp 更新​

更新 SMTP 设置。只有您传递的字段会发生变化;系统将保留现有配置的其他所有内容。

选项​

长值描述
--host <host>字符串SMTP 服务器主机名。
--port <port>1–65535 整数SMTP 服务器端口。
--username <username>字符串SMTP 身份验证用户名。
--password <password>字符串SMTP 身份验证密码。只写(从不回读)。
--domain <domain>字符串SMTP 身份验证域。
--enable-ssl <value>true|false启用 SSL/TLS。
--use-default-credentials <value>true|false使用 Windows 默认凭据,而非用户名/密码。
--from-address <email>电子邮件发件人电子邮件地址。
--from-display-name <name>字符串发件人显示名称。
--connection-timeout <ms>1–300000 整数连接超时(以毫秒为单位)。

至少需要一个选项。

示例​

uip admin smtp update --host smtp.example.com --port 587
uip admin smtp update --host smtp.example.com --port 587
uip admin smtp update --host smtp.example.com --port 587 --username user@example.com \
  --password secret --from-address noreply@example.com --enable-ssl true
uip admin smtp update --host smtp.example.com --port 587 --username user@example.com \
  --password secret --from-address noreply@example.com --enable-ssl true

数据形状(--输出 json)​

{ "Code": "SmtpSettingsUpdated", "Data": { "host": "smtp.example.com", "port": "587", "...": "same shape as smtp get" } }
{ "Code": "SmtpSettingsUpdated", "Data": { "host": "smtp.example.com", "port": "587", "...": "same shape as smtp get" } }

UIP 管理员 SMTP 删除​

删除组织的所有 SMTP 设置—删除整个电子邮件配置。

示例​

uip admin smtp delete
uip admin smtp delete

数据形状(--输出 json)​

{ "Code": "SmtpSettingsDeleted", "Data": { "Status": "Deleted successfully" } }
{ "Code": "SmtpSettingsDeleted", "Data": { "Status": "Deleted successfully" } }

uip admin smtp 测试​

使用当前保存的设置发送测试电子邮件,或一组内联设置,而不保存这些设置。

选项​

长值必填描述
--recipient <email>电子邮件是测试电子邮件的目标发送地址。
…相同 update否可选 — 传递任何子集以测试自定义设置而不保存。需要 --password 与自定义配置,除非 --use-default-credentials true。

示例​

# Test the saved configuration
uip admin smtp test --recipient admin@example.com
# Test the saved configuration
uip admin smtp test --recipient admin@example.com
# Test a custom configuration without saving it
uip admin smtp test --recipient admin@example.com --host smtp.example.com --port 587 \
  --username user@example.com --password secret
# Test a custom configuration without saving it
uip admin smtp test --recipient admin@example.com --host smtp.example.com --port 587 \
  --username user@example.com --password secret

数据形状(--输出 json)​

{ "Code": "SmtpTestSent", "Data": { "Recipient": "admin@example.com", "Status": "Test email sent successfully" } }
{ "Code": "SmtpTestSent", "Data": { "Recipient": "admin@example.com", "Status": "Test email sent successfully" } }

另请参阅​

此页面有帮助吗?

连接

需要帮助? 支持

想要了解详细内容? UiPath Academy

有问题? UiPath 论坛

保持更新