From 19f818ea1880cd0c7dbe5ab90d2c515dd00ddaa9 Mon Sep 17 00:00:00 2001 From: Nereo Berardozzi Date: Wed, 2 Nov 2016 18:50:41 +0100 Subject: [PATCH 1/3] Update mail.md --- 1.8/faq/mail.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/1.8/faq/mail.md b/1.8/faq/mail.md index a027a153..bf1efdf6 100644 --- a/1.8/faq/mail.md +++ b/1.8/faq/mail.md @@ -50,7 +50,14 @@ If your webhost only allows sites to send mail from their own domain, edit the f Find: ```php - mail($to, $subject, $message, $headers); + if($mybb->safemode) + { + $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers)); + } + else + { + $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers), $this->additional_parameters); + } ``` Add before: @@ -61,7 +68,14 @@ Add before: The final result of the edit should be: ```php ini_set("sendmail_from", "forum@YOURDOMAIN.com"); - mail($to, $subject, $message, $headers); + if($mybb->safemode) + { + $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers)); + } + else + { + $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers), $this->additional_parameters); + } ``` `YOURDOMAIN` in the above code must be replaced by the domain where the forum is hosted. From 0d0a38fb1b7d0d9ed75c3a4558c0730b34ff2f7f Mon Sep 17 00:00:00 2001 From: Nereo Berardozzi Date: Wed, 2 Nov 2016 20:02:21 +0100 Subject: [PATCH 2/3] Update mail.md --- 1.8/faq/mail.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1.8/faq/mail.md b/1.8/faq/mail.md index bf1efdf6..f6fcf41a 100644 --- a/1.8/faq/mail.md +++ b/1.8/faq/mail.md @@ -46,11 +46,11 @@ It should say `Mail was sent by PHP` and there should not be any errors displaye Some webhosts place restrictions on PHP mail. For example, some require that the `From` address be an address configured on their server; other hosts may disable the PHP mail function completely.Check with your webhost if there are any restrictions in place for sending mail via PHP. -If your webhost only allows sites to send mail from their own domain, edit the file `inc/functions.php` to try a workaround fix. +If your webhost only allows sites to send mail from their own domain, edit the file `inc/mailhandlers/php.php` to try a workaround fix. Find: ```php - if($mybb->safemode) + if($mybb->safemode) { $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers)); } From ce3451e32e8d54cb67cd4a090fd522c17e9fa1a8 Mon Sep 17 00:00:00 2001 From: Nereo Berardozzi Date: Wed, 2 Nov 2016 20:28:51 +0100 Subject: [PATCH 3/3] Update mail.md --- 1.8/faq/mail.md | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/1.8/faq/mail.md b/1.8/faq/mail.md index f6fcf41a..0453d059 100644 --- a/1.8/faq/mail.md +++ b/1.8/faq/mail.md @@ -50,14 +50,7 @@ If your webhost only allows sites to send mail from their own domain, edit the f Find: ```php - if($mybb->safemode) - { - $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers)); - } - else - { - $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers), $this->additional_parameters); - } + $mail = new PhpMail(); ``` Add before: @@ -68,14 +61,7 @@ Add before: The final result of the edit should be: ```php ini_set("sendmail_from", "forum@YOURDOMAIN.com"); - if($mybb->safemode) - { - $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers)); - } - else - { - $sent = @mail($this->to, $this->subject, $this->message, trim($this->headers), $this->additional_parameters); - } + $mail = new PhpMail(); ``` `YOURDOMAIN` in the above code must be replaced by the domain where the forum is hosted.