Jump to content

soapergem

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

soapergem's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I was able to figure it out. Basically, SMS messaging [i]always[/i] completely ignores whatever "additional headers" you pass in to it. However, what it's really looking for is any additional [i]parameters[/i], which I wasn't even defining. The mail function is defined as follows: [!--sizeo:1--][span style=\"font-size:8pt;line-height:100%\"][!--/sizeo--][!--coloro:#009999--][span style=\"color:#009999\"][!--/coloro--]bool[!--colorc--][/span][!--/colorc--] [!--coloro:#0000FF--][span style=\"color:#0000FF\"][!--/coloro--]mail[!--colorc--][/span][!--/colorc--] ( [!--coloro:#009999--][span style=\"color:#009999\"][!--/coloro--]string[!--colorc--][/span][!--/colorc--] [b]to[/b], [!--coloro:#009999--][span style=\"color:#009999\"][!--/coloro--]string[!--colorc--][/span][!--/colorc--] [b]subject[/b], [!--coloro:#009999--][span style=\"color:#009999\"][!--/coloro--]string[!--colorc--][/span][!--/colorc--] [b]message[/b] [, [!--coloro:#009999--][span style=\"color:#009999\"][!--/coloro--]string[!--colorc--][/span][!--/colorc--] [b]additional_headers[/b] [, [!--coloro:#009999--][span style=\"color:#009999\"][!--/coloro--]string[!--colorc--][/span][!--/colorc--] [b]additional_parameters[/b]]] )[!--sizec--][/span][!--/sizec--] And the additional parameter we need to add is precisely this: [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]'-fme@my.address.com'[!--colorc--][/span][!--/colorc--] For some reason, I think it's important that you leave no space between the [!--coloro:#CC0000--][span style=\"color:#CC0000\"][!--/coloro--]-f[!--colorc--][/span][!--/colorc--] and your e-mail address. Not sure why, but I think it is. Anyways, that worked. To summarize, this is the code I am now using (with no problems): [code]mail($to_addr, $subj, $message, NULL, '-fme@my.address.com');[/code]
  2. [!--quoteo(post=364330:date=Apr 13 2006, 03:50 AM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Apr 13 2006, 03:50 AM) [snapback]364330[/snapback][/div][div class=\'quotemain\'][!--quotec--]Won't the "gibberish" on the front end of the delivered message be appended by the server it passes through before delivery to the phone?[/quote] Well, then my question is this: is there some way to prevent that?
  3. I've seen myriad PHP classes available on the web that allow people to send text messages to cell phones using HTTP gateways. That, however, is not what I am interested in. From what I've seen, all HTTP gateways charge money to use their services (correct me if I'm wrong). Also, that method is kind of "lazy" since it simply sends a set of POST vars to another server that will then have to do something with them. Why do that when you can use built-in PHP functions to do it yourself? (Again, correct me if I'm being presumptuous about PHP's abilities.) Anyways, I've been doing some testing sending out text messages using the mail() function, and while these tests have been successful, I can really only say that they're partially successful. I often end up with a bunch of gibberish at the beginning. Here's one example. I used the following PHP code to try and send a test message to a friend of mine, Andrew. I've pretty obviously changed his phone number to protect the innocent. Here's the code: [code]$to_addr = '<123456789@vtext.com>'; $subject  = 'Hey Andrew'; $message  = "Hey Andrew. So, um, I'm testing this.\r\n"; $message .= "Does it work?\r\n"; $message .= "The following letters should all be on different lines:\r\n"; $message .= "a\r\n"; $message .= "b\r\n"; $message .= "c\r\n"; $headers  = "From:<me@my.address.com>\r\n"; $headers .= "Content-Type:text/plain;charset=iso-8859-1\r\n"; mail($to_addr, $subject, $message, $headers);[/code] But, much to my dismay, this code produced the following message on his phone: [code]Fr:SRS0=hGuo=6D =perfora.net=cg i-mailer-bounces -1048 (Hey Andrew) Hey. So, um, I'm testing this. Does it work? The following letters should all be on different lines:[/code] I think the reason the last three lines were truncated has to do with the character limit, although I'm not positive on that. So here's my question to pose to all of you intellectual giants: how do I get rid of the gibberish? What am I doing wrong? I feel like I'm so close, since the messages are successfully delivered, but I just can't seem to shake that random gibberish that appears. I've tried a couple of variations on the $headers, too. Any help is appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.