Skip to content

Commit

Permalink
feat(Send Email Node): Add an option to customize client host-name on…
Browse files Browse the repository at this point in the history
… SMTP connections (#9322)
  • Loading branch information
netroy committed May 7, 2024
1 parent 491c6ec commit d0d52de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/nodes-base/credentials/Smtp.credentials.ts
Expand Up @@ -41,5 +41,13 @@ export class Smtp implements ICredentialType {
type: 'boolean',
default: true,
},
{
displayName: 'Client Host Name',
name: 'hostName',
type: 'string',
default: '',
placeholder: '',
description: 'The hostname of the client, used for identifying to the server',
},
];
}
4 changes: 4 additions & 0 deletions packages/nodes-base/nodes/EmailSend/v2/send.operation.ts
Expand Up @@ -210,6 +210,10 @@ function configureTransport(credentials: IDataObject, options: EmailSendOptions)
secure: credentials.secure as boolean,
};

if (typeof credentials.hostName === 'string' && credentials.hostName) {
connectionOptions.name = credentials.hostName;
}

if (credentials.user || credentials.password) {
connectionOptions.auth = {
user: credentials.user as string,
Expand Down

0 comments on commit d0d52de

Please sign in to comment.