smtp tool cant not work when Send emails to multiple people #100

Closed
opened 2026-02-22 17:18:40 -05:00 by yindo · 3 comments
Owner

Originally created by @agoraphobiaX on GitHub (Jun 15, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.4.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

smtp tool cant not work when Send emails to multiple people。

Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for SendEmailToolParameters\nsender_address\n Field required [type=missing, input_value={'smtp_server': 'smtp.yn....], 'bcc_recipients': []}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.8/v/missing"}

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @agoraphobiaX on GitHub (Jun 15, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.4.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce smtp tool cant not work when Send emails to multiple people。 Failed to transform tool message: PluginInvokeError: {"args":{},"error_type":"ValidationError","message":"1 validation error for SendEmailToolParameters\nsender_address\n Field required [type=missing, input_value={'smtp_server': 'smtp.yn....], 'bcc_recipients': []}, input_type=dict]\n For further information visit https://errors.pydantic.dev/2.8/v/missing"} ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-22 17:18:40 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jun 15, 2025):

The error happens because the required sender_address field is missing from the parameters when sending to multiple recipients. This is likely due to how the parameters are constructed and passed to the SMTP tool—if sender_address is omitted or set to None, Pydantic validation fails and you get this error.

To resolve this, make sure that sender_address is always included in the tool parameters, regardless of how many recipients you have. Double-check your workflow or plugin configuration to ensure sender_address is set and not accidentally dropped when building the parameter dictionary for multi-recipient sends. Also, confirm that your MAIL_DEFAULT_SEND_FROM is set in your environment or config, as this is used as a fallback if sender_address is not provided directly (source).

If you’re customizing the workflow, review the parameter generation logic to ensure sender_address is always present, especially in multi-recipient scenarios (source). This should resolve the validation error and allow emails to be sent to multiple people.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Join Discord Share on X

@dosubot[bot] commented on GitHub (Jun 15, 2025): <!-- Answer --> The error happens because the required sender_address field is missing from the parameters when sending to multiple recipients. This is likely due to how the parameters are constructed and passed to the SMTP tool—if sender_address is omitted or set to None, Pydantic validation fails and you get this error. To resolve this, make sure that sender_address is always included in the tool parameters, regardless of how many recipients you have. Double-check your workflow or plugin configuration to ensure sender_address is set and not accidentally dropped when building the parameter dictionary for multi-recipient sends. Also, confirm that your MAIL_DEFAULT_SEND_FROM is set in your environment or config, as this is used as a fallback if sender_address is not provided directly ([source](https://github.com/langgenius/dify/blob/d587480a3e4c38333860331c3684ddc6f771ca01/api/extensions/ext_mail.py)). If you’re customizing the workflow, review the parameter generation logic to ensure sender_address is always present, especially in multi-recipient scenarios ([source](https://github.com/langgenius/dify/blob/d587480a3e4c38333860331c3684ddc6f771ca01/api/core/workflow/nodes/tool/tool_node.py)). This should resolve the validation error and allow emails to be sent to multiple people. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/cab9cd78-c839-4074-bb0b-877c0a851219?feedback_type=other)</sup>&nbsp;&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/21034)
Author
Owner

@agoraphobiaX commented on GitHub (Jun 15, 2025):

how to make sure that sender_address is always included in the tool parameters?
becaues when i send mail to one person it works.

@agoraphobiaX commented on GitHub (Jun 15, 2025): how to make sure that sender_address is always included in the tool parameters? becaues when i send mail to one person it works.
Author
Owner

@crazywoola commented on GitHub (Feb 3, 2026):

Hi @agoraphobiaX, thanks for opening this issue.

Why this is being closed

Dify issue tracking requires English-only issue title and description for consistent collaboration.

Next steps

Please open a new issue in English and include clear details so maintainers can help efficiently.

Thanks for understanding and for your support.

@crazywoola commented on GitHub (Feb 3, 2026): Hi @agoraphobiaX, thanks for opening this issue. ### Why this is being closed Dify issue tracking requires English-only issue title and description for consistent collaboration. ### Next steps Please open a new issue in English and include clear details so maintainers can help efficiently. Thanks for understanding and for your support.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-plugins#100