Send an email from a controller

Hello KJDingwall,

Welcome to the forums! That file has to go in a very specific place in your controller’s file system, in this sub-folder:
So when you’re doing the upload from PAC Manager, it should look something like this:

Also make sure you have your Gateway and DNS configured ( is the default, which won’t work). That’s another common thing that trips people up.

If you have for those values, select: Tools > Change IP Settings (in PAC Manager).

Hope that helps!

So everything works for me except that I get the 2104 error - which is an invalid root cert. I downloaded the equifax from the opto22 website link, and installed it but still get the same error

Sorry, missed your post.
Working now, missed the full path on the cert download.

Excellent! One thing you’ll want to be careful with too is to make sure you have logic that will STOP the e-mails from going out over and over (like Ben mentions in the first post of this thread) so you don’t end up sending a whole ton of them and possibly causing mail servers to flag your emails as spam.

Happy e-mailing!

Hi there,

I did exactly what you said, but the -2104 error comes up all the time, i uploded the EquifaxSecure certificate to the sub folder you specified , i upgraded the firmware, i am using pac 9.1c, the dns and gateway are configured…i dont know what to do!!! , PLEASE HELP…

Thanks Guys, i figured out what the problem was!!!, i didn’t save the file to the flash…

Hi Lawga,

Glad that you got it working… Just a note for others that follow in your footsteps… Not only do you have to save the certificate file to that special location, AND save the file to flash, BUT THEN you MUST REBOOT!!!
The reason is that the file is only extracted and copied to RAM when the controller is rebooted.

Email on !


Cannot get text messaging to work with sprint ( We have been using At&t text messaging with no problems. Any advice?

Hi Tim,

I just tested the service from my email on my PC to my phone and it worked straight away…
So, I suggest that you break it down a bit.
Try it from a PC or laptop email client on the same network as the controller.
Once you are confident that is working ok, then turn your attention to the controller strategy and settings.
Remember, you must set the DNS and Gateway on the controller via PAC Manager.
Since it was working… what changes have been made other than the email address?



Thank you for your advice. Sending email using PC to phone has always been working on the network the controller is using. However, I can never send text message within the strategy. I know that DNS and Gateway on the controller is set correctly because it can send text message to AT&T phone but not to Sprint (all content sent to both cell phone are identical). If you can test it in your test strategy and see if you have the same problem.

System Set-up:
Controller type: R2
PAC Basic 9.2
Network: Remote Access - Controller to wireless router with aircard (Sprint)
Router: Proxicast


We do a fair bit of text messaging and emailing with our controllers. We had an issue about a year ago where it suddenly stopped working on a client’s system. Turns out that the client had switched their phones to a different carrier (Rogers up here in Canada) and that carrier no longer supports email-to-text capabilities. It still works on most carriers up here but Rogers no longer does.

The simplified bottom line was Rogers doesn’t like third party email-to-text commands running through their servers (such as an outside request from an Opto controller) and blocked/stopped supporting it.

The way we got around it was by setting up email addresses for all the message recipients and dropping the email polling/push settings on their phones really low (I think default on an iPhone is 15mins… by that time you could have a lot of trouble on your hands!!). Not an ideal solution but it works.

If it doesn’t work to send an email to the phone ( is what I’m showing as the correct addressing) from a PC, there’s a good chance you’re in the same boat that I was. However it sounds like you have that working. I have a simple test strategy running on our in-house test rack that I use to test email-to-text functionality. If you send me a message with the phone number in question, I can certainly shoot it a test message through our mail server and let you know the result.

Hi Tim,

Sorry you’re having trouble. I tried sending (via my gmail account) to several email addresses including the text message address of my Verizon cell phone ( and a borrowed Sprint phone. Sprint message never showed up (like you saw) but all the others did. So did emailing from a regular email account, like you saw.

Also, I sent Arlin (thanks for volunteering your email server, Arlin!) this Sprint number. In the past we’ve had luck sorting out such issues when another kind OptoForum user was able to send the detailed information their email server got back, so I’m hoping Arlin will see some clues coming back from

In the meantime, I could tell you a few other things I don’t like about Sprint, but I’ll refrain. I’m liking Verizon even more now!


Sprint exists to make other phone companies look good!

Unfortunately, since no errors appear to come back, the text/email just vanishes into the void, I’m not sure what else to try. It works fine, all else being the same, for AT&T and Verizon. I’m guessing Sprint support would be a frustrating maze, but don’t have any other ideas. Anyone else?

have you considered putting a GSM modem in rather than using an email-to-text service for SMS? this way you can send an SMS direct from the controller instead of relying on an email service. the organization i work at has 18 or so controllers and each controller has a GSM modem attached to a serial port and all SMS messages are sent from there. we even accept SMS messages as a high-level control feature to start our generators.
might be an option for your client if the current system is failing?

another real option is to use instant messaging. check out the post
works with gtalk and jabber clients and coupled with an instant messaging app on your smart phone (like IMO on iOS) its pretty instantaneous (as long as there is an internet connection)

Okay all you email fans, we had a customer who wanted to do “unauthenticated email” (like our old / mem map stuff used to do) and apparently the SendEmail command won’t let you do that.

Although, I’d love to hear what “unauthenticated” means to you, since I’ve found a variety of options. We DID add a few options to the SendEmail command(s) in PAC Control, including this one in 9.3e firmware (from the readme): Added the ability to send an email with no user account name from within the strategy.

But that wasn’t going to cut it for a favorite OptoFan who contacted me with another “unauthenticated email” request. However, he was kind enough to donate the code he came up with. It uses the old mem map stuff, but, since it’s part of a strategy, saves some time since all that’s need is self-contained in the strategy. No restart required. He also points out that: “this sends to two separate email addresses, more can be added.”

BTW, before you copy/paste this into your strategy, please make sure you change those “two separate email address” he used for an example, or our IT folks might get upset. :slight_smile:

Add in Powerup:

  Server_IP = IpAddressStringToInt32("");// First write the Server IP address
  ntMemMapData[0] = Server_IP;
  ntMemMapData[1] = bitnot Server_IP; // 1s Complement
  Scratch_Pad_Bit_Status = WriteNumTableToIoUnitMemMap(2,0,TestEmail, 0xFFFFF1300000, ntMemMapData );//Server IP
  Scratch_Pad_Bit_Status = WriteNumToIoUnitMemMap(TestEmail, 0xFFFFF1300004, 25 ); //Port #
  Scratch_Pad_Bit_Status = WriteNumToIoUnitMemMap(TestEmail, 0xFFFFF1200004, MakeInt64(0, 2));
  Scratch_Pad_Bit_Status = WriteNumToIoUnitMemMap(TestEmail, 0xFFFFF120001C, 1 );

The next snippet goes in its own chart as a single pass after a trigger somewhere else:

  Scratch_Pad_Bit_Status = WriteStrToIoUnitMemMap(TestEmail, 0xFFFF130003A, "" ); //Email From
  Scratch_Pad_Bit_Status = WriteStrToIoUnitMemMap(TestEmail, 0xFFFF1300008, "" ); //Email To
  WriteStrToIoUnitMemMap(TestEmail, 0xFFFF130006C, "Oh Happy Day" ); //Email Subject Line
  DelayMsec(1000 );
  SetIoUnitEventMsgText(TestEmail, 0, Test_Email );
  Scratch_Pad_Bit_Status = SetIoUnitScratchPadBitsFromMomo( TestEmail, 2, 0 );
  DelayMsec(1000 );
  Scratch_Pad_Bit_Status = SetIoUnitScratchPadBitsFromMomo( TestEmail, 0, 2 );
  DelayMsec(300 );
  Scratch_Pad_Bit_Status = WriteStrToIoUnitMemMap(TestEmail, 0xFFFF1300008, "" );
  DelayMsec(1000 );
  SetIoUnitEventMsgText(TestEmail, 0, "Hi Ben" );
  Scratch_Pad_Bit_Status = SetIoUnitScratchPadBitsFromMomo( TestEmail, 2, 0 );
  DelayMsec(1000 );
  Scratch_Pad_Bit_Status = SetIoUnitScratchPadBitsFromMomo( TestEmail, 0, 2 );
  DelayMsec(1000 );

Thanks for sharing, OptoDan!


I am trying to get my PAC-R1 to send an email (eventually with attachments) using Mary’s example chart. When I run the chart I get nResult = 202. From the documentation it looks like it should not give me a positive number for nResult (it will equal 0 for success, and a negative integer if it failed). However, in the documentation under status code -43:

“Received NACK (Negative Acknowledgement). The mail server returned an error (other than a 200- or 300-series response).”

I think I am getting a 200-series response, and I’m not sure what that means. Also, depending on what Port# I use (I tried 25, 465, and 587), I get nResult = -43. So I think they are related. Does anyone know what would cause this error? Or if someone can point me to where I can find documentation on 200- and 300-series status codes that would be very helpful too.


Hello jm54321 aka Jordan,
Welcome to the OptoForums! I’m sorry you’re having trouble.
Looks like you might be running into [U][B]this issue (KB84549).[/B][/U] If a beta is available, would you be interested in trying the not-quite-fully QA’d firmware?
BTW, what email server are you using? There are a few little weird things w/gmail’s servers…

Hi Mary, thanks for the reply. I’ll have to pass on the non-QA’d firmware for my current application. However, you are correct that I am using a gmail server, and I have a feeling the issue is still on my end. I haven’t found much info on the settings to use for gmail, except this brief website:

Do you have any other tips/tricks/advice for connecting with gmail servers?


Hey Mary,

I was just digging through the forums here and wanted to ask if there was any elaboration on the “weird things with Gmail’s servers”. We’ve been using a business Gmail account to send alarm notifications to various customers for quite some time now. For the most part, everything goes off without a hitch. Recently, I had a controller start returning 202 and -2104 errors. I ran through with Opto22 Support for quite awhile and we never really got anywhere. We ended up replacing the S1 and everything started working again, but it was quite a hassle. It’s a large customer site with a lot of floating point data to save.

Today, I’ve run into another customer where it appears to be similar. They’d been receiving their email alerts fine for quite some time. I was receiving the 202 error, and then after a restart of the controller, it’s switched to -2104.

Any ideas?