Skip to content

To: undisclosed-recipients #91

Description

@krulis-martin

I would like to suggest a modification of SmptMailer to define "To:" header with undisclosed-recipients: ; content when Bcc was removed and no other recipient headers are sent. I have been just struggling with sendmail SMTP server that does not like it when no "To" header is set (and I need to send only anonymous notifications from my Nette app).

I think adding

		if (!$tmp->getHeader('To') && !$tmp->getHeader('Cc')) {
			// missing recipient headers make some mailers (e.g., sendmail) nervous, so we set To like MTAs does
			$tmp->setHeader('To', 'undisclosed-recipients: ;');
		}

right after line 75 (where $tmp->setHeader('Bcc', null); is) in SmptMailer.php should do the trick...

Activity

  1. dg commented on Mar 1, 2023

    @dg
    Member

    That makes sense, please send PR and test.

  2. krulis-martin commented on Mar 6, 2023

    @krulis-martin
    ContributorAuthor

    PR #92 ready for your inspection ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions