Page 2 of 2

Re: PHP Mail

PostPosted: Fri Mar 14, 2014 11:05 pm
by Mechano
There isn't any mailer-daemon listening on localhost also modifying the php.ini the mail will not go...

You need to use PEAR library and the PHPMailer class to send thru an external SMTP server with authentication.

Code: Select all
require_once('/library/PHPMailer/class.phpmailer.php');
$mail = new \PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = 'login';
$mail->SMTPSecure = 'ssl';
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Username = 'example@gmail.com';
$mail->Password = 'somepassword';
$mail->SetFrom('example@gmail.com', 'Example');
$mail->Subject = 'The subject';
$mail->Body = 'The content';
$mail->AddAddress('receiver@gmail.com');
$mail->Send();


There's also another way, using plain PHP, if your cable/ADSL provider gives you SMTP server without authentication change localhost with it's smtp server.

Re: PHP Mail

PostPosted: Sat Mar 15, 2014 12:00 am
by Kapitein Haak
ADM 2.2 will support a mailserver on the NAS. This might take a few weeks however.

BR, Kapitein Haak.

Re: PHP Mail

PostPosted: Wed Apr 02, 2014 10:36 am
by murray
Kapitein Haak wrote:ADM 2.2 will support a mailserver on the NAS. This might take a few weeks however.

BR, Kapitein Haak.


Hi Kaipitein Haak
I have a Asustor AS-304T and I have setup a local website which works well. This Wordpress site has a "Contact Us" page which needs to send an email. Please confirm the discussion here is addressing this issue and I am on the right track to solving the problem. If yes then are you saying if I wait a few weeks then you will have a solution using a mailserver for the AS-304T?
Thanks.............Murray

Re: PHP Mail

PostPosted: Wed Apr 02, 2014 5:36 pm
by Mechano
murray wrote:
Kapitein Haak wrote:ADM 2.2 will support a mailserver on the NAS. This might take a few weeks however.

BR, Kapitein Haak.


Hi Kaipitein Haak
I have a Asustor AS-304T and I have setup a local website which works well. This Wordpress site has a "Contact Us" page which needs to send an email. Please confirm the discussion here is addressing this issue and I am on the right track to solving the problem. If yes then are you saying if I wait a few weeks then you will have a solution using a mailserver for the AS-304T?
Thanks.............Murray


You have to use a plugin that uses external SMTP servers.
Like this:
http://wp-ecommerce.net/easy-wordpress- ... erver-2197

Re: PHP Mail

PostPosted: Mon Apr 21, 2014 2:29 pm
by freecom
Hello, did you find a solution to use sendmail ?

Re: PHP Mail

PostPosted: Thu May 08, 2014 11:13 pm
by Mechano
freecom wrote:Hello, did you find a solution to use sendmail ?


Nope, cant' wait for the new ADM 2.2 that promises to fill di lack...

Re: PHP Mail

PostPosted: Fri Sep 05, 2014 10:34 pm
by gianluigi1982
1. I installed the Mail server App
2. It works as mail server
3. I installed a template with a Contact page that ask for the mail() function.
4. It doesn't work.
5. I installed a plugin in Wordpress called WP SMTP
6. Then I changed the function in the template from mail (..........) to wp_mail(..........)
7. In this way it works

The only remaining issue is that many functions from the template contact page don't work:
- mail from : mail will arrive from the sender you specified in the WP SMTP settings page
- Subject: subject will be what you specified in the WP SMTP settings page

Hope it will be useful to someone.

Re: PHP Mail

PostPosted: Thu Mar 05, 2015 7:31 pm
by gianluigi1982
I already configured the Mail Server App on my NAS.
I configured the SMTP server and it works only with Wordpress by configuring the wp_mail() function.

I tried to edit the php.ini by inserting the smtp server installed but the "standard" mail() function doens't work.

I am trying to set a second webpage (in Wordpress too) andI need the mail() function to make the OpenConf platform to correctly works.
I also tried to edit the OpenConf files to use wp_mail() without success.

Is there anyone who solved this issue?

Many thanks.

Gianluigi