Community Support Forums — WordPress® ( Users Helping Users ) — 2011-12-27T15:45:56-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=14957 2011-12-27T15:45:56-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=58954#p58954 <![CDATA[Re: New User Email Messages Not Sending]]>
I'm not sure if you got this solved, but you may want to take a look at this thread: viewtopic.php?f=4&t=16451&p=58863#p58863

Statistics: Posted by Raam Dev — December 27th, 2011, 3:45 pm


]]>
2011-11-28T11:50:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=54081#p54081 <![CDATA[Re: New User Email Messages Not Sending]]>
I estimate that about 60% of my new users are not able to complete their registration process. They pay via PayPal but then get a 500 server error or some other error.

Also, when I manually add a new user (which I have to do in the above cases) sometimes I when I add the new member I get a 500 Internal error after clicking "Add Member." The user account IS created but the new user email does not get sent and I have to manually create one.

If anyone has any thoughts on how to fix this, let me know? I really want to keep MediaTemple and to move all my sites there.

Thanks - Ryan

Statistics: Posted by ryannagy — November 28th, 2011, 11:50 am


]]>
2011-10-21T17:10:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=48534#p48534 <![CDATA[Re: New User Email Messages Not Sending]]> viewtopic.php?f=4&t=15555&p=48533#p48533

Also, please remember that emails will NOT be processed by s2Member if your Payment Gateway integration is incomplete in some way. It's always a good idea to enable s2Member's Logging/Debugging routines so you can see the communication that occurs behind-the-scene. s2Member's log files will tell you when, and to whom, email messages were sent to. For instance, with PayPal, check your Dashboard here:
s2Member -> PayPal Options -> Account Details -> Logging/Debugging

Statistics: Posted by Jason Caldwell — October 21st, 2011, 5:10 pm


]]>
2011-10-21T13:15:49-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=48514#p48514 <![CDATA[Re: New User Email Messages Not Sending]]>
Can somebody help me here, as this is stopping my affiliate programme, and Click*Bank are looking to withdraw my product.

This is why I bought Pro, so I need some help here!

Thannkd

Statistics: Posted by bertranddory — October 21st, 2011, 1:15 pm


]]>
2011-10-21T12:13:34-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=48507#p48507 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by leoquijano — October 21st, 2011, 12:13 pm


]]>
2011-10-21T01:22:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=48471#p48471 <![CDATA[Re: New User Email Messages Not Sending]]>
Thanks for the update! I'm coming back to that project very soon, so I'll take a look from my side and verify everything's working good.

Statistics: Posted by leoquijano — October 21st, 2011, 1:22 am


]]>
2011-10-20T16:11:24-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=48412#p48412 <![CDATA[Re: New User Email Messages Not Sending]]> ~ Thanks for the great feedback.

Statistics: Posted by Jason Caldwell — October 20th, 2011, 4:11 pm


]]>
2011-10-09T19:27:36-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=45222#p45222 <![CDATA[Re: New User Email Messages Not Sending]]>
WordPress wp_mail() Filter:
Code:
/**
* Filters email addresses passed to ``wp_mail()``.
*
* @package s2Member\Email_Configs
* @since 3.5
*
* @attaches-to ``add_filter("wp_mail");``
* @uses {@link s2Member\Utilities\c_ws_plugin__s2member_utils_strings::parse_emails()}
*
* @param array $array Expects an array passed through by the Filter.
* @return array Returns the array passed through by the Filter.
*/
public static function email_filter ($array = FALSE)
    {
        if (isset ($array["to"]) && !empty ($array["to"])) /* Filter list of recipients? */
            /* Reduces `"Name" <email>`, to just an email address *(for best cross-platform compatibility across various MTAs)*. */
            /* Also works around bug in PHP versions prior to fix in 5.2.11. See bug report: <https://bugs.php.net/bug.php?id=28038>. */
            /* Also supplements WordPress®. WordPress® currently does NOT support semicolon `;` delimitation, s2Member does. */
            $array["to"] = implode (",", c_ws_plugin__s2member_utils_strings::parse_emails ($array["to"]));
        /**/
        return apply_filters ("ws_plugin__s2member_after_email_filter", $array, get_defined_vars ());
    } 

Utility routine:
Code:
/**
* Parses email addresses from a string or array.
*
* @package s2Member\Utilities
* @since 111009
*
* @param str|array $value Input string or an array is also fine.
* @return array Array of parsed email addresses.
*/
public static function parse_emails ($value = FALSE)
    {
        if (is_array ($value)) /* Handles all types of arrays.
        Note, we do NOT use ``array_map()`` here, because multiple args to ``array_map()`` causes a loss of string keys.
        For further details, see: <http://php.net/manual/en/function.array-map.php>. */
            {
                $emails = array (); /* Initialize array of emails. */
                foreach ($value as $_value) /* Loop through array. */
                    $emails = array_merge ($emails, c_ws_plugin__s2member_utils_strings::parse_emails ($_value));
                return $emails; /* Return array of parsed email addresses. */
            }
        /**/
        $delimiter = (strpos ((string)$value, ";") !== false) ? ";" : ",";
        foreach (($sections = c_ws_plugin__s2member_utils_strings::trim_deep (preg_split ("/" . preg_quote ($delimiter, "/") . "+/", (string)$value))) as $section)
            {
                if (preg_match ("/\<(.+?)\>/", $section, $m) && strpos ($m[1], "@") !== false)
                    $emails[] = $m[1]; /* Email inside brackets. */
                /**/
                else if (strpos ($section, "@") !== false)
                    $emails[] = $section;
            }
        /**/
        return (!empty ($emails)) ? $emails : array ();
    } 

Statistics: Posted by Jason Caldwell — October 9th, 2011, 7:27 pm


]]>
2011-10-08T15:05:02-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=45137#p45137 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by Jason Caldwell — October 8th, 2011, 3:05 pm


]]>
2011-10-07T19:53:28-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=45084#p45084 <![CDATA[Re: New User Email Messages Not Sending]]>
http://www.php.net/manual/en/function.preg-replace.php


subject
The string or an array with strings to search and replace.

If subject is an array, then the search and replace is performed on every entry of subject, and the return value is an array as well.


;) glad the issue report helped

Statistics: Posted by leoquijano — October 7th, 2011, 7:53 pm


]]>
2011-10-07T19:52:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=45083#p45083 <![CDATA[Re: New User Email Messages Not Sending]]>
I'm not exactly sure what the bug is, by I've seen this happen on a client's site recently, where all calls to wp_mail() resulted in a 503 server error on MediaTemple (gs), and all we got was an error in the Apache log about a premature end of script headers ( which is nothing to go on ). I ran the same code on another client's site, from a different MT cluster/node, and the bug did not exist. Just to be certain, we're going to go back through and run some additional tests against the PHP 5.2.x bug reported above, just to rule that out. However, I believe at this point that these two issues are unrelated.
ryannagy wrote:
I am having a similar problem. I am manually adding several members. The members get added but I get an error message: "Internal Server Error.The server encountered an internal error or misconfiguration and was unable to complete your request."

At first the welcome emails were not sent. But then I deleted the plugin New User Email Setup By Alex Cragg in favor of S2Members built-in functionality. However, I am still getting the error message above. Though notification emails appear to be getting through.

Thoughts? I have got multiple affiliates sending out mass emails soon and would like to figure out what is going on ASAP. This is my first set-up using MediaTemple hosting. Perhaps I neglected to do something.

Statistics: Posted by Jason Caldwell — October 7th, 2011, 7:52 pm


]]>
2011-10-07T19:44:58-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=45082#p45082 <![CDATA[Re: New User Email Messages Not Sending]]> Awesome work on this.
Thanks for letting me know about this bug in some versions of PHP.
leoquijano wrote:
Got it !!!

Ok, for the record, I'm using PHP 5.2.6 in a Windows box. This version of PHP has a known bug in the mail() implementation:

https://bugs.php.net/bug.php?id=28038

The bug was fixed in 5.2.11 and in 5.3.x branches.

Though actually, if you read the discussion there, they treat it as a workaround and not a bug fix. According to RFC2821, the RCPT TO field in an e-mail message must be e-mail only:
http://tools.ietf.org/html/rfc2821#section-6
OK, I'm taking a closer look at this now and I'll post an update once we have a good handle on how we're going to work around this issue. In the mean time, your hack looks like a good temporary solution. Watch out for array values though. The wp_mail() function accepts both a string and/or an array of strings in the to variable. See: http://codex.wordpress.org/Function_Reference/wp_mail
Code:
add_filter("wp_mail", "filter_wp_mail");

function filter_wp_mail($vars) {
  $vars["to"] = /* Could be an array here. */ preg_replace("/.*<(.*)>.*/i", "$1", $vars["to"]);
  return $vars;
}
 

Statistics: Posted by Jason Caldwell — October 7th, 2011, 7:44 pm


]]>
2011-10-04T11:49:17-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44820#p44820 <![CDATA[Re: New User Email Messages Not Sending]]>
At first the welcome emails were not sent. But then I deleted the plugin New User Email Setup By Alex Cragg in favor of S2Members built-in functionality. However, I am still getting the error message above. Though notification emails appear to be getting through.

Thoughts? I have got multiple affiliates sending out mass emails soon and would like to figure out what is going on ASAP. This is my first set-up using MediaTemple hosting. Perhaps I neglected to do something.

Statistics: Posted by ryannagy — October 4th, 2011, 11:49 am


]]>
2011-10-03T23:36:23-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44774#p44774 <![CDATA[Re: New User Email Messages Not Sending]]>
Code:
add_filter("wp_mail", "filter_wp_mail");

function filter_wp_mail($vars) {
  $vars["to"] = preg_replace("/.*<(.*)>.*/i", "$1", $vars["to"]);
  return $vars;
}


By the way, Jason, do you think it would be feasible to provide a s2member specific configuration for the content-type? Right now this is fixed as "text/plain" in email-configs.inc.php, but it would be nice to be able to use HTML content (even select it from the plugin admin page).

I know I can filter it using "wp_mail_content_type", but that filters ALL email generated from Wordpress, including email from random plugins. So, as a suggestion, adding that capability to s2member would be nice.

Statistics: Posted by leoquijano — October 3rd, 2011, 11:36 pm


]]>
2011-10-03T22:47:01-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44765#p44765 <![CDATA[Re: New User Email Messages Not Sending]]>
Ok, for the record, I'm using PHP 5.2.6 in a Windows box. This version of PHP has a known bug in the mail() implementation:

https://bugs.php.net/bug.php?id=28038

The bug was fixed in 5.2.11 and in 5.3.x branches.

Though actually, if you read the discussion there, they treat it as a workaround and not a bug fix. According to RFC2821, the RCPT TO field in an e-mail message must be e-mail only:
http://tools.ietf.org/html/rfc2821#section-6

The bug patch includes a patch for PHP that prevents the mail() call (which is used by PHPMailer, which in turn is used by Wordpress, which is used by s2Member) from enveloping the address with "<" and ">".

Anyone with a Windows box (pre-5.2.11) to confirm? Maybe a workaround is in order?

I think I can workaround it with the "wp_mail" filter, but this might bug other Windows users with older PHP versions (lower PHP 5.2 versions are still very common I think)

Statistics: Posted by leoquijano — October 3rd, 2011, 10:47 pm


]]>
2011-10-03T22:11:27-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44759#p44759 <![CDATA[Re: New User Email Messages Not Sending]]>
RCPT TO:<My Name <my@email_address.com>501 Invalid Address5221

I changed my name and my email, but notice that an additional, unclosed, "<" was added.
I'm now trying to figure out if it's a problem with my SMTP config, or if some plugin is interfering with the mail() call.

Statistics: Posted by leoquijano — October 3rd, 2011, 10:11 pm


]]>
2011-10-03T22:02:50-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44757#p44757 <![CDATA[Re: New User Email Messages Not Sending]]> Is this it? http://wordpress.org/extend/plugins/wp-mail-smtp/

Statistics: Posted by Jason Caldwell — October 3rd, 2011, 10:02 pm


]]>
2011-10-03T21:53:54-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44755#p44755 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by s_d_p — October 3rd, 2011, 9:53 pm


]]>
2011-10-03T19:10:42-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=44748#p44748 <![CDATA[Re: New User Email Messages Not Sending]]> Thanks for reporting this important issue.

I've been unable to reproduce this so far, but I see what you're describing. Can you please tell me what other plugins that you're running on this installation? Any other plugin that works to supplement the core wp_mail() function in some way?

"John Doe" <john_doe@gmail.com> is a valid recipient address, so I'd like to find the underlying cause as opposed to reducing the recipient down to just the email address.

Statistics: Posted by Jason Caldwell — October 3rd, 2011, 7:10 pm


]]>
2011-09-30T13:41:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=41991#p41991 <![CDATA[Re: New User Email Messages Not Sending]]>
I managed to track the problem down - for new registrations, I haven't tested payment confirmations - to this line in classes/email-configs.inc.php:

email-configs.inc.php(line 238):

Code:
c_ws_plugin__s2member_email_configs::email_config () . wp_mail ([b]'"' . c_ws_plugin__s2member_utils_strings::esc_dq ($user_full_name) . '" <' . $user->user_email . '>'[/b], $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") . c_ws_plugin__s2member_email_configs::email_config_release (); 


By replacing the "to" parameter of the wp_mail function to just the e-mail address, the email gets sent:

Code:
c_ws_plugin__s2member_email_configs::email_config () . wp_mail ([b]$user->user_email[/b], $sbj, $msg, "From: \"" . preg_replace ('/"/', "'", $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_name"]) . "\" <" . $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["reg_email_from_email"] . ">\r\nContent-Type: text/plain; charset=utf-8") . c_ws_plugin__s2member_email_configs::email_config_release (); 


So the problem, at least for me, it's s2member trying to send email to
"John Doe" <john_doe@gmail.com>
, instead of just sending to
john_doe@gmail.com
.

I'm using Windows IIS and s2member 110927.
Thoughts?

Statistics: Posted by leoquijano — September 30th, 2011, 1:41 pm


]]>
2011-09-28T09:01:18-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=41839#p41839 <![CDATA[Re: New User Email Messages Not Sending]]>
I just tested it and I had no email. I only got the administrator notice saying there is a new user, but not the custom email with the username and password. Any thoughts?

Thanks!

Dana

Statistics: Posted by dskallman — September 28th, 2011, 9:01 am


]]>
2011-09-27T20:03:40-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=41733#p41733 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by Jason Caldwell — September 27th, 2011, 8:03 pm


]]>
2011-09-26T23:57:41-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=40449#p40449 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by Cristián Lávaque — September 26th, 2011, 11:57 pm


]]>
2011-09-14T07:15:44-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=37189#p37189 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by dskallman — September 14th, 2011, 7:15 am


]]>
2011-09-14T02:11:46-05:00 http://www.primothemes.com/forums/viewtopic.php?t=14957&p=37164#p37164 <![CDATA[Re: New User Email Messages Not Sending]]> Statistics: Posted by Cristián Lávaque — September 14th, 2011, 2:11 am


]]>