Skip to content

Unable to send email using SendmailMailer in v4.0.2 #96

@zabous

Description

@zabous

Version: 4.0.2

Bug Description

I have very simple code to send email using SendmailMailer.
Everything is working in nette/mail v3.1.11. When I upgrade to nette/mail v4.0.2 there is error:

Nette\Mail\SendException - Unable to send email

Steps To Reproduce

Try this code with nette/mail v3.1.11 (working) and with v4.0.2 (not working)

$mail = new Nette\Mail\Message;
$mail->setFrom('Franta <franta@example.com>')
	->addTo('petr@example.com')
	->setSubject('Potvrzení objednávky')
	->setBody("Dobrý den,\nvaše objednávka byla přijata.");
$mailer = new Nette\Mail\SendmailMailer;
$mailer->send($mail);

It seems to me, that the problem is on line SendmailMailer.php on line 52 - after removal it work ok.
$cmd .= ' -f' . key($from);

Expected Behavior

Code is working with both versions (v3.1.11 and v4.x.x)

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