Save SMTP settings
PUT
/v1/setup/smtp
const url = 'http://localhost:8080/v1/setup/smtp';const options = { method: 'PUT', headers: {'Content-Type': 'application/json'}, body: '{"host":"example","port":1,"tlsMode":"example","username":"example","password":"example","fromAddress":"example","fromName":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url http://localhost:8080/v1/setup/smtp \ --header 'Content-Type: application/json' \ --data '{ "host": "example", "port": 1, "tlsMode": "example", "username": "example", "password": "example", "fromAddress": "example", "fromName": "example" }'Step 4. Stores the relay host, port, TLS mode (none, starttls, ssl), optional credentials and the from address and name; a blank password keeps the stored one. Resets setup.smtp_tested: send a test email (POST /v1/settings/test/smtp) before activation. Administrators only. 400 for invalid fields.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
host
string
port
integer | string format: int32
tlsMode
None | starttls | ssl
string
username
null | string
password
Empty keeps the stored password.
null | string
fromAddress
string
fromName
string
Examplegenerated
{ "host": "example", "port": 1, "tlsMode": "example", "username": "example", "password": "example", "fromAddress": "example", "fromName": "example"}Responses
Section titled “Responses”No Content