Announcement

#1 2011-02-15 12:06:05

saber
Member
2011-02-15
32

[resolved] Email notifications - how these work?

Could anyone let me know if there are any configuration/settings for email notification as it does not seem to work for me?

I tried sending mail using "Send mail to users" functionality and it did say

■Mail sent to admin [admin's email removed from here].
■1 mail has been sent.

but no mail received.

It also doesn't send any subscription/unsubscription notification as expected.

I'm running Piwigo 2.1.6 on godaddy.com hosting server and my host does allow php mail (I think it does, as I tried sending mail via mail() function in a php file which works fine).

Could anyone also let me know what notifications are supposed to be sent/received by subscribed users?

Any help would be highly appreciated.

Thanks

Offline

 

#2 2011-02-16 23:01:18

rub
Piwigo Team
Lille
2005-08-26
5019

Re: [resolved] Email notifications - how these work?

No mail on spam?

Offline

 

#3 2011-02-17 06:27:27

saber
Member
2011-02-15
32

Re: [resolved] Email notifications - how these work?

Nopes, no mail on spam.

So I guess no configuration required for emails. It should have worked as is.

Any ideas?

Thanks,

Offline

 

#4 2011-02-17 06:47:16

rub
Piwigo Team
Lille
2005-08-26
5019

Re: [resolved] Email notifications - how these work?

No try to use smtp option on local config?

Could you give your site link? On MP if you want!

Offline

 

#5 2011-02-17 09:09:51

saber
Member
2011-02-15
32

Re: [resolved] Email notifications - how these work?

How to try SMTP option?

Have sent link to your email.

Thanks,

Offline

 

#6 2011-02-19 08:56:08

rub
Piwigo Team
Lille
2005-08-26
5019

Re: [resolved] Email notifications - how these work?

saber wrote:

How to try SMTP option?

I registered on your site. Could you try to send me a mail.

saber wrote:

Have sent link to your email.

With local file editor, there are smtp lines.

Offline

 

#7 2011-02-20 07:44:26

saber
Member
2011-02-15
32

Re: [resolved] Email notifications - how these work?

Have added you to subscriptions, so you should receive a notification.

I have also sent you an email via "Send mail to users"

Let me know if you receive these 2 emails.

Piwigo messages attached for you info.

Offline

 

#8 2011-02-20 08:36:03

rub
Piwigo Team
Lille
2005-08-26
5019

Re: [resolved] Email notifications - how these work?

I received nothing!

I try "forgot password" and it's the same thing.

Are you contact too your hosting support?

Offline

 

#9 2011-02-22 19:54:42

saber
Member
2011-02-15
32

Re: [resolved] Email notifications - how these work?

It may be quite dumb to ask, but anyways, what I need to ask from hosting suppor? I thought pwg was using PHP mail function which works well on my site. Is pwg using some other method of mail?

Can you guide me to the instructions for setting up the SMTP option?

Thanks

Offline

 

#10 2011-02-23 06:50:27

rub
Piwigo Team
Lille
2005-08-26
5019

Re: [resolved] Email notifications - how these work?

saber wrote:

It may be quite dumb to ask, but anyways, what I need to ask from hosting suppor? I thought pwg was using PHP mail function which works well on my site. Is pwg using some other method of mail?

Works with a simple example.
Piwigo send html and invisibles recipients.
Support can see error on their log.

Try to send mail without html options.
There are an option on NBM
or with plugin localfileeditor:

Code:

// default_email_format:
//  Define the default email format use to send email
//  Value could be text/plain  or text/html
$conf['default_email_format'] = 'text/plain';

saber wrote:

Can you guide me to the instructions for setting up the SMTP option?

with plugin localfileeditor:

Code:

// smtp configuration
// (work if fsockopen function is allowed for smtp port)
// smtp_host: smtp server host
//  if null, regular mail function is used
//   format: hoststring[:port]
//   exemple: smtp.pwg.net:21
// smtp_user/smtp_password: user & password for smtp identication
$conf['smtp_host'] = '';
$conf['smtp_user'] = '';
$conf['smtp_password'] = '';

With plugin localfileeditor on personal plugin section you can add log on a mail directory:

Code:

/* Log Mail on files */
add_event_handler('send_mail', 'pwg_send_mail_log', 1, 6);
function pwg_send_mail_log($result, $to, $subject, $content, $headers, $args)
{
    global $conf, $user, $lang_info;
    $dir = $conf['local_data_dir'].'/mail';
    if ( mkgetdir( $dir,  MKGETDIR_DEFAULT&~MKGETDIR_DIE_ON_ERROR) )
    {
      list($curdate, $curtime) = mysql_fetch_row(pwg_query('SELECT CURDATE(), CURTIME();'));
      $filename = $dir.'/'.
                  str_replace('-', '', $curdate).'.'.str_replace(':', '', $curtime).'.'.
                  'mail.'.$user['username'].'.'.$lang_info['code'].'.'.$args['theme'];
      if ($args['content_format'] == 'text/plain')
      {
        $filename .= '.txt';
      }
      else
      {
        $filename .= '.html';
      }
      $file = fopen($filename, 'w+');
      fwrite($file, $to ."\n");
      fwrite($file, $subject ."\n");
      fwrite($file, $headers);
      fwrite($file, $content);
      fclose($file);
    }
    return $result;
}

Offline

 

#11 2011-02-26 15:22:44

saber
Member
2011-02-15
32

Re: [resolved] Email notifications - how these work?

I tried the SMTP option and started getting following errors:

Warning: fsockopen() [function.fsockopen]: unable to connect to relay-hosting.securesever.net:25 (Connection refused) in/{...}/piwigo/include/class_smtp_mail.inc.php on line 108

Warning: Could not connect to smtp host "relay-hosting.securesever.net:25" (111) (Connection refused) in/{...}/piwigo/include/class_smtp_mail.inc.php on line 177

Warning: Cannot modify header information - headers already sent by (output started at /{...}/piwigo/include/class_smtp_mail.inc.php:108) in /{...}/piwigo/include/page_header.php on line 98

After googling a lot on these errors, I finally found that it has something to do with the email headers, as my hoster, godaddy.com filters email headers for spam mails.

The solution as posted on http://community.godaddy.com/groups/ema … rom-forum/ is:

[Quote

Just spent all day banging my head against this with tech support to absolutely no avail.

There’s a big thread about the problem over at Simple Machines Forums. Here’s a link to the golden post:
http://www.simplemachines.org/community … msg2921276

In short, Godaddy is spam-filtering outgoing email with this header:

X-Mailer: SMF

It wasn’t in the body of my email, it wasn’t the activation link, it’s that header that’s the culprit.

The solution:
* Edit your Sources/Subs-Post.php file,
* Change X-Mailer: SMF to to X-Mailer: SMX

Unquote]

Could you please clarify, if something of this sort is in use in Piwigo mail function?

I think sending to invisible recipients could be a culprit as well.

Offline

 

#12 2011-02-26 15:36:27

rub
Piwigo Team
Lille
2005-08-26
5019

Re: [resolved] Email notifications - how these work?

Try that:
Modify file include/functions_mail.inc.php.
Delete line:

Code:

  $headers.= 'X-Mailer: Piwigo Mailer'."\n";

or replace by

Code:

  $headers.= 'X-Mailer: SMX'."\n";

Offline

 

#13 2011-02-28 06:49:19

saber
Member
2011-02-15
32

Re: [resolved] Email notifications - how these work?

And finally the email started firing!!!

It was an issue with the headers but not with 'X-Mailer:' rather with 'From:' entry. Godaddy.com blocks any outgoing mails with "From:" header entry of aol, gmail, yahoo, hotmail, live, aim, or msn. I had my gmail account for admin email that was being blocked...

Offline

 

#14 2013-02-20 03:28:58

shugrue
Guest

Re: [resolved] Email notifications - how these work?

SMTP will also fail if the "From" field in the php.ini file is empty. No php.ini, add one with PHP Config in Software/Service on the cPanel. Then edit with File Manager on the cPanel and add a real email address.

 

#15 2016-06-29 17:54:34

Shu
Guest

Re: [resolved] Email notifications - how these work?

saber wrote:

And finally the email started firing!!!

It was an issue with the headers but not with 'X-Mailer:' rather with 'From:' entry. Godaddy.com blocks any outgoing mails with "From:" header entry of aol, gmail, yahoo, hotmail, live, aim, or msn. I had my gmail account for admin email that was being blocked...

How did you do that and make  the change?

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2022 · Contact