Skip to content

To: undisclosed-recipients #91

@krulis-martin

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions