Answer the question
In order to leave comments, you need to log in
Sendmail xampp stub?
Please tell me how to make a sendmail stub for xampp on mac os 10.11, I found a couple of articles but it says about windows, on mac it's a little different, I will be grateful for your help.
Answer the question
In order to leave comments, you need to log in
In php.ini
[mail function]
sendmail_from = [email protected]
sendmail_path = "php /any/path/you/want/sendmail_simple_emulator.php"
<?php
// Заглушка sendmail
// based at http://urths.com/blog/заглушка-sendmail/
$MailDir = __DIR__.'/log/'; // папка для сохранения писем
if (!is_dir($MailDir)) {
mkdir($MailDir, 0644);
}
$data = "";
$line = 'foo';
$f = fopen("php://stdin", "r");
while( !feof($f) AND ($line!='') ) {
$line = fgets($f,255);
$data .= $line;
}
fclose($f);
$data = str_replace("\r", '', $data);
$data = str_replace("\n", PHP_EOL, $data);
$i = 0;
$addon = '';
while ( file_exists( $fname = ($MailDir.'/'.date('Y-m-d-H-i-s').$addon.'.eml') )) {
$i++;
$addon = '-'.$i;
}
file_put_contents($fname, $data);
You need to use a driver in your email sending library that either folds letters locally or uploads them to mailtrap servers.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question