Sending (SMS) Picture Messages With ColdFusion And CFMail

Posted June 25, 2007 at 7:20 AM by Ben Nadel

Tags: ColdFusion

A while back, I talked about sending text messages (SMS messages) to mobile phones using ColdFusion and CFMail. Well, walking down the street today, surrounding by young woman in scantily clad summer outfits, I wondered if the same could be done with picture messages (PIX Messages). At first, I tried to send a picture to my VText email address using ColdFusion's CFMailParam tag (sending the picture as an attachment). The message went through to my phone, but only as text message.

After some Googling, I found out that several phone carriers allow you to send email-based SMS picture messages, but these require different email addresses than the SMS text messages. For Verizon, my cellular carrier, text messages get send to NUMBER@vtext.com, but PIX messages need to be sent to NUMBER@vzwpix.com. Here are the SMS picture message emails for some of the more popular carriers:

AT&T Wireless

NUMBER@mmode.com

Cingular

NUMBER@mms.mycingular.com

Sprint

NUMBER@pm.sprint.com

T-Mobile

NUMBER@tmomail.net

Verizon

NUMBER@vzwpix.com

Equip with this new knowledge, sending the PIX message was quite easy:

  • <!---
  • Send the pix message. This will send the text
  • message in the CFMailPart in addition to the image.
  • --->
  • <cfmail
  • to="5555555555@vzwpix.com"
  • from="ben@xxxxxxxx.com"
  • subject="Have fun at CFUNITED!">
  •  
  • <!--- Send text message. --->
  • <cfmailpart type="text/plain">Have Fun!</cfmailpart>
  •  
  • <!--- Send image as attachment. --->
  • <cfmailparam
  • file="#ExpandPath( './beach_girls_640_480_at_30.jpg' )#"
  • type="image/jpg"
  • />
  •  
  • </cfmail>

PIX messages can send both a picture and a text message at the same time. In the above code, notice that I am using the CFMailPart to sent the text message in addition to the CFMailParam tag to send the image as an attachment. I, of course, can only test this on Verizon Wireless, but I assume the technology is pretty uniform across the different carriers.

If you look at the image that I am attaching, you might have noticed that it contains "640_480" and ends with "at_30". The first part is the image dimensions that I am using. My LG Verizon cell phone can handle image dimensions up to 640 x 480 pixels. To maximize the image quality, I am going to use the largest dimensions possible. The ending part of the file name, "at_30", is the JPEG compression that I was using. Compression is a funny thing when it comes to cell phones; it's counterintuitive. Normally, a 30 compression is horrible! Look at the beach girls image at quality-30 compression at normal size:


 
 
 

 
 Beach Girls At 30 Quality Compression  
 
 
 

As you can see, this compression has taken something beautiful and made it ugly. Your gut tells you to use something more standard, like a quality-80 compression:


 
 
 

 
 Beach Girls At 80 Quality Compression  
 
 
 

Clearly, a much nicer and more satisfying image. But, what we forget is that most cell phones (unless you have one of those really nice ones) have crap resolutions; image quality is really poor no matter what. In fact, when I send a 30 and an 80 quality compression image to my cell phone, they look exactly the same. The only difference becomes file size. The 30-quality image above is 12 Kb. The 80-quality image is a whopping 53 Kb. And, since most cell phones have limited storage capacity, you are going to want to optimize file size as much as possible.

Just a final note, PIX messages are much more expensive than text messages (not for any sort of technology reasons - just cause they say so), so don't go crazy emailing images to people.




Reader Comments

Jun 25, 2007 at 10:10 AM // reply »
1 Comments

Me and my girlfriends are never going to the beach with again. How dare you post our pic on the web. BTW, we really had a good time especially back at the bungalow.


Dec 3, 2007 at 3:50 PM // reply »
1 Comments

So I tryed number@vzwpix.com and it doesn't work anymore.


Dec 3, 2007 at 3:54 PM // reply »
11,314 Comments

That's lame. Stupid cellular carriers with their restrictions. Why can't they just let us use their service, no hassles.


nad
Mar 3, 2009 at 7:07 AM // reply »
1 Comments

sweet


Sep 10, 2009 at 1:30 PM // reply »
1 Comments

the number@vzwpix.com does work


Sep 12, 2009 at 10:09 PM // reply »
11,314 Comments

@Josh,

It's possible that the number has been changed; it's also possible that is being blocked however you are trying to do it.


sun
Mar 13, 2010 at 6:16 PM // reply »
2 Comments

@tmomail.net is NOT correct! IS t-mobile addy ... but, ONLY for a txt msg!


sun
Mar 13, 2010 at 6:21 PM // reply »
2 Comments

MY BAD! @tmomail.net IS correct ... but, ONLY from pic taken W/ a cell -- NOT as attachment in an email ... (took ~4 min. for it to arrive ... then would NOT DL to my cell)


Mar 15, 2010 at 9:45 AM // reply »
11,314 Comments

@Sun,

Thanks for the update. I've only ever had Verizon / AT&T, so my testing is rather limited.


Aug 23, 2010 at 4:13 AM // reply »
1 Comments

I also tried but It doesn't work.


Aug 30, 2012 at 5:06 PM // reply »
1 Comments

aslamoalikum


Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Jun 19, 2013 at 2:01 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
I have coincidentally been beating my head against the S3 API for the last week or so. One big "gotcha" I had to work around was file names and paths containing spaces. Remember to URL Enco ... read »
Jun 19, 2013 at 1:27 PM
Using Slice(), Substring(), And Substr() In Javascript
very good article. By the way IE supports negative values in substr or slice in verson 10. ... read »
Jun 19, 2013 at 11:33 AM
Filter vs. ngHide With ngRepeat In AngularJS
In your assessment, is it correct to say that given a list of say 500 items its more performant to use the `ngHide` method over the `filter` method? ... read »
Jun 19, 2013 at 10:18 AM
ColdFusion Path Usage And Manipulation Overview
Anyone happen to know if the file created by getTempFile will be automatically removed at any point? Nothing mentioned in the docs, and restarting CF doesn't remove them, so it seems it needs manu ... read »
Jun 19, 2013 at 9:41 AM
Working With Inherited Collections In AngularJS
I actually just ran into this same situation with a demo I was putting together. Your implementation of multi-lvl $scope's > Mine :) ... read »
Jun 19, 2013 at 8:17 AM
My Experience With AngularJS - The Super-heroic JavaScript MVW Framework
@Prateek, to match a word or text you should use .toContain('word') that's a jasmine reference. website is : http://pivotal.github.io/jasmine/ ... read »
Jun 19, 2013 at 8:10 AM
My Experience With AngularJS - The Super-heroic JavaScript MVW Framework
Hi Guys, Actually i am doing e2e test of angular js of my project but i am not getting one thing that is how to press enter key through the test when my form is filled as i am not using a button but ... read »
Jun 18, 2013 at 9:20 PM
Mapping AngularJS Routes Onto URL Parameters And Client-Side Events
I couldn't find examples of passing multiple arguments using the when() routing statement so figured out through trial and error that you can pass multiple arguments using the following format: .whe ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools