Notifications that are supposed to be sent out via SMS when new content is added are not being sent. I see the following message.

* warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\Server\Apache Software Foundation\Apache2.2\htdocs\includes\mail.inc on line 193.
* Unable to send e-mail. Please contact the site administrator if the problem persists.

Could there be a problem with the params?

However, "send to phone" and "sms blast" both work just fine. I found this post that looked at the same error message but couldn't find anything that gave me insight.

I am running drupal on a Windows server.

Thanks for any help you can give me.

mrweaver

Comments

mattrweaver’s picture

Title: SMS notifications not being sent, but other SMS modules work » SMS notifications not being sent: another error

The phone number below ends in "@". Shouldn't it end in "vtext.com" which would be for verizon?

Error sending e-mail (from webmaster@mysite.org to 5555555555@)

I'm not sure if I should post this issue here, or with the messaging module. I would appreciate any help in diagnosis this.

mrweaver

NROTC_Webmaster’s picture

I was having the same issue and I can't remember exactly what I did to fix it but I know in I made the following changes

sms_user.module
Line 431

-    $user_data = unserialize($account->data);
+    $user_data = $data;
-    $account->sms_user = $user_data['sms_user'];

sms_email_gateway.module
Line 194

-  $to = $number .'@'. $options['carrier'];
+  $to = $number['number'] .'@'. $number['gateway']['carrier'];

and it works for me.

I was having an unserialize error message and a few other problems which made me switch between various versions of this module messaging and notifications.

I'm using the email gateway with the following versions
Messaging 6.x-4.x-dev (2011-Jun-12)
Notifications 6.x-4.x-dev (2011-Feb-26)
SMS Email Gateway 6.x-1.0
SMS Framework 6.x-2.x-dev (2011-Mar-30)

mattrweaver’s picture

Title: SMS notifications not being sent: another error » WSOD

I uninstalled the previous version of these modules and installed the versions you noted and got the WSOD, and I could not enable the modules. Did you have such a problem when you were working with various versions of these modules?

mattrweaver’s picture

Title: WSOD » SMS framework and notifications

Anyone? Bueller? Help? Please?

NROTC_Webmaster’s picture

Did you install all of them at once or one at a time. If you tried to install all of them at once go back and try them one at a time and see which one gives you the WSOD. That should help narrow it down a little bit.

I have only received the WSOD a couple times and by deleting the last module I installed and then checking the recent log or the server log I was able to track it down.

I hope this helps.

mattrweaver’s picture

When I took SMS Framework 6.x-2.x-dev down to 6.x-2.0-alpha1, the WSOD issue upon node creation went away.

NROTC_Webmaster’s picture

Is the alpha version working for you or are you still having the same problem?

mattrweaver’s picture

Still having the same (original) problem, but no more WSOD.

I just tried sending a notification and got this:

warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\...
\htdocs\includes\mail.inc on line 193.

The confirmation message was successfully sent to the phone, and a notification that went to email was successful.

mrweaver

mattrweaver’s picture

Hm. But I tried a test SMS message from "admin/messaging/settings/test" and got that error message while "send to phone" works. I think I might have this message in the wrong queue. Maybe this is a "messaging" module problem?

mattrweaver’s picture

Actually, this was right, although I have more problems to sort out. I am planning on using a single gateway for messaging.

When I tried replacing "$options['carrier']" with "$number['gateway']['carrier']" it didn't work. In my logs, I saw that the carrier info was not being sent. When I replaced "$options['carrier']" with the identifier for my gateway, it worked fine.

At least I now know that this is the module I'm having trouble with, and have a clue what to target.

Thanks

mrweaver

charos’s picture

mrweaver, did you finally solve this issue because I'm on the same boat with my sms gateway for about a year now and I'm stuck. How did you get the name of the gateway identifier and which line is that?

NROTC_Webmaster’s picture

charos,

Mine isn't working anymore. I tried both of the options I had listed above and it just will not pass the carrier info to the sms email gateway. I know it is there because I am able to receive the messages when I add the phone number to the account but I cannot receive any messages after that through sms.

mattrweaver’s picture

I have continued to use the hack in #10.

charos’s picture

mrweaver, can you be a bit more specific on which line you are referring to and what replacements you did? I've read your post #10 several times but I can't figure it out.
I think it will help also to post the module(s) version you are using!

Thanks!

mattrweaver’s picture

In sms_email_gateway.module
Line 194

I changed

$to = $number .'@'. $options['carrier'];

to

$to = $number .'@'. 'sms.yourcarrier.com';

I added the identifier for my specific carrier in place of the '$options['carrier']' variable.

It sucks that I have to hack the module like this, but it works for me. It works because I am using a single gateway. Your mileage may vary.

Are you running on Windows servers?

mrweaver

charos’s picture

Thanks for the reply.
I'm using Clickatell gateway module and have same issues with Notifications. So I'm trying to figure out what to change in my case to make it work. If I can't figure it out, I might go for the email gateway as well!

mattrweaver’s picture

Is your site on Windows servers? (not related to Clickatel, just curious)

NROTC_Webmaster’s picture

My problem is that my users have multiple carriers so I cannot specify just one. Realistically this all seems to go back to the problem that I had with it showing up as a nearly endless number of logs saying the data could not be unserialized because it expected a string and an array was given. I still have no idea when it would have been changed from a string to an array and I have not found an effect way to debug it. I still have only a very basic understanding of PHP and do not know how to go about truly understanding it enough to fix this. If anyone can help me out I would really appreciate it.

I'm on Bluehost with a Linux server.

The funny thing is when I try to dump the data it shows it as an Array which makes sense considering the way it was stored in the database. The part that is stored as a string is the gateway information which contains the carrier information as you can see below if you do the following
all of this is in the sms_user.module

  $result = db_query("SELECT number, status, code, gateway FROM {sms_user} WHERE uid = %d", $account->uid);

  $account->sms_user = array();
  while ($data = db_fetch_array($result)) {
-    $user_data = unserialize($data);
+    $user_data = $data;
    $account->sms_user = $user_data['sms_user'];
    $account->sms_user['number'] = $data['number'];
    $account->sms_user['status'] = $data['status'];
    $account->sms_user['code'] = $data['code'];
    $account->sms_user['gateway'] = unserialize($data['gateway']);
+  drupal_set_message(dprint_r($data, 1));
  }

if you print the data

Array
(
    [number] => 5555555555
    [status] => 2
    [code] => 
    [gateway] => a:1:{s:7:"carrier";s:23:"messaging.sprintpcs.com";}
)

if you try to print the gateway before you unserialize you will not get an output but if you print after you unserialize you will get

$account->sms_user['gateway'] = unserialize($data['gateway']);
drupal_set_message(dprint_r($account->sms_user['gateway'], 1));
(
    [carrier] => messaging.sprintpcs.com
)

so if you print just the carrier info from the gateway it will give you

drupal_set_message(dprint_r($account->sms_user['gateway']['carrier'], 1));
(
    [carrier] => messaging.sprintpcs.com
)

So I know the data is there I just don't know how to go about passing this information appropriately to the sms_email_gateway module

Messaging 6.x-4.x-dev (2011-Nov-11)
Notifications 6.x-4.x-dev (2011-Feb-26)
SMS Email Gateway 6.x-1.0
SMS Framework 6.x-2.0-alpha1

mattrweaver’s picture

Hm.

I'm on a Window server and just assumed that was the problem. When I researched the error message at the initial post in this thread, I seem to recall (it's been a while) that it is related to how something in this group of modules sends variables to send mail on Windows servers.

NROTC_Webmaster’s picture

I think I might have figured out the problem but I need someone else to confirm this for me before I submit rebase the issue.

In messaging/messaging_sms/messaging_sms.module on line 59 change

  if (!empty($account->sms_user) && $account->sms_user[0]['status'] == 2 && !empty($account->sms_user[0]['number'])) {
-    return $account->sms_user[0]['number'];
  }

to 

  if (!empty($account->sms_user) && $account->sms_user[0]['status'] == 2 && !empty($account->sms_user[0]['number'])) {
+    if (!empty($account->sms_user[0]['gateway']['carrier'])) {
+      return $account->sms_user[0]['number'] .'@'. $account->sms_user[0]['gateway']['carrier'];
+    }
+    else {
+      return $account->sms_user[0]['number'];
+    }
  }

and then change sms_email_gateway/sms_email_gateway.module line 194 from

-  $to = $number .'@'. $options['carrier'];

to

+  if (!empty($options['carrier'])) {
+    $to = $number .'@'. $options['carrier'];
+  }
+  else {
+    $to = $number;
+  }

and I think it might work. The problem I'm assuming is that months ago when sms_email_gateway was split into a separate module they never bothered to update messaging_sms.module for the proper implementation. So when it passes the parameters it isn't doing it correctly. I'm also sure there is a better way to do this but I just want something that works for the time being until an expert can look at this.

NROTC_Webmaster’s picture

Project: SMS Framework » Messaging
Version: 6.x-1.0 » 6.x-4.x-dev
Component: Miscellaneous » SMS Plugin
StatusFileSize
new1.12 KB
new3.02 KB

I'm going to change this to the messaging framework because I think that is where the initial problem lies. Please let me know if this patch makes sense or if this should be in a different place because of the multiple modules using it.