0

I want to send extra parameter to mail function in magento. I didn't find any raw mail function in magento, can any one help me where I will get that function.

mail($to, $subject, $message, $headers, 'Iwantopassthis@test.com'); // I want to pass 5th parameter
1

If you magento is using sendmail to send an email, you can find the mail() function in Zend_Mail_Transport_Sendmail. Check the method public function _sendMail().

You can find this file in lib/Zend/Mail/Transport/Sendmail.php of your magento 1 root and vendor/magento/zendframework1/library/Zend/Mail/Transport/Se‌​ndmail.php in your magento2 root. Also it is not recommended to edit this file directly. If you want to modify this, copy this file to app/code/local/Zend/Mail/Transport/Sendmail.php (there won't such directories by default but you can create) and then modify the method _sendMail();

  • Where we can find Zend_Mail_Transport_Sendmail class – Lead Developer Oct 7 '16 at 6:29
  • Updated my answer. – Nidheesh Oct 7 '16 at 7:07
  • Thank you!. @Nidheesh. Magento 2 We can find the function here vendor/magento/zendframework1/library/Zend/Mail/Transport/Sendmail.php – Lead Developer Oct 7 '16 at 8:24
0

The additional_parameters parameter can be used to pass an additional parameter.

<?php
mail('nobody@example.com', 'the subject', 'the message', null,
   '-fwebmaster@example.com');
?>

For more detail additional-parameters

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.