Hello there,
I have a problem when I try to send an email from the datalogger using an office 365 email address. I have tried using gmail and it works perfectly.
I am using a CR1000 with OS version 28.02 (I have also tried with version 27 and it doesn't work either).
The office 365 email address has been tested and it's working correctly, it has been tested with outlook and with powershell and it send emails correctly.
The internet connection of the logger it's provided through a GPRS modem connected to the RS232 port (PPP).
The code is something like this:
Const ServerAddr = "smtp.office365.com:587"
Const FromAddr = "email@businessdomain.com"
Const UserName = "email@businessdomain.com"
Const Password = "MyPassword"
Const ToAddr = "emailaddres@mail.com"
Const Subject = "Data file from datalogger station from Test"
Const TableToSend = "Test_Table"
Const CRLF = CHR(13) + CHR(10)
Const Message = "Hello," + CRLF + CRLF + "This is an automatic email message from the datalogger station from Test. Please find the daily data file attached."
Public EmailResult As String * 150
Public EmailSuccess As Boolean
EmailSuccess = EmailSend (ServerAddr,ToAddr,FromAddr,Subject,Message,TableToSend,UserName,Password,EmailResult,0,10,Min,8)
If I replace the first four lines with this:
Const ServerAddr = "smtp.gmail.com:587"
Const FromAddr = "myemail@gmail.com"
Const UserName = "myemail@gmail.com"
Const Password = "MyPassword"
It works.
So I'm guessing it's not associated with DNS as smtp.gmail.com works. And it's not associated with TLS as version 28 ignores this setting (and its enabled by default).
Do you guys have any ideas?
Thanks in advance,
Luis
Try with full user name of "email@businessdomain.com@office365.com".
Thanks pokeeffe. That doesn't work, I've just tried.
I have some additional information. The comms watch messages from the datalogger are these:
22:54:03.05 email rx: 220 DB3PR05CA0060.outlook.office365.com Microsoft ESMTP MAIL Service ready at Wed, 2 Sep 2015 20:54:02 +0000
22:54:03.06 EHLO CR1000
22:54:03.06 .campbellsci.com
22:54:03.87 email rx: 250-SIZE 157286400
22:54:03.88 email rx: 250-PIPELINING
22:54:03.88 email rx: 250-DSN
22:54:03.89 email rx: 250-ENHANCEDSTATUSCODES
22:54:03.89 email rx: 250-STARTTLS
22:54:03.89 email rx: 250-8BITMIME
22:54:03.90 email rx: 250-BINARYMIME
22:54:03.90 email rx: 250 CHUNKING
22:54:03.90 STARTTLS
22:54:04.31 email rx: 220 2.0.0 SMTP server ready
22:54:05.23 EHLO CR1000
22:54:05.23 .campbellsci.com
22:54:13.54 Closing handle 191. Connection reset.
22:54:39.22 SSL_READ ERROR -256
22:54:39.22 Email failed
Maybe someone can shed some light on this? The last message SSL_READ ERROR -256 could indicate the problem?
Thanks
Hello,
We've a similar issue, can you tell if you finally got a solution?
In our case, gmail is not working and we just receive message telling
"220 2.0.0 Ready to start TLS"
We're using a CR1000 + NL121 to access to the internet.
Thanks.
@Jlillo - In your case of using Gmail, I had to go into my gmail account log in settings and "allow less secure" devices. This only needs to be done on the account that you are trying to use to send the email.
Hello Jlillo,
I don't have a problem with Gmail accounts, the problem I have is when I use an officee 365 email account.
As thommark said, you need to turn on "Access for less secure apps" in google settings. Have a look here for more info:
Hi Thommark,
I started having problems with Gmail email sending starting from 04-11-15, 05-11-15 & 13-11-15 on by one on three of my dataloggers which all three successfully emailed before. I did turn on, "Allow for less secure apps" in my google account settings.
I do not have a remote access to my dataloggers. Today I went to site to check all three dataloggers, it turned out as, Jlillo said, "220 2.0.0 Ready to start TLS" and stop there nothing comes out. Do you have other solutions instead of "Allow for less secure apps" as I've already allowed.
I tried with my business domain, it passed thru "Ready to TLS", but finally come out error message, "501, syntax error in arguments" and stop. Do you have a solution for this as well.
Thanks,
It looks like Google has changed the requirements for the login/authentication process and the CR1000/CR800 are currently unable to meet these new requirements. This is independent of the 'allow less secure apps" setting found in your account's sign-in & security settings.
This was a change made recently by Google and we are still looking into it. We well have more details soon.
I have successfully used the CR1000 with the following free email services:
GMX
http://www.gmx.com/
Zoho
https://www.zoho.com/mail/
Hotmail
https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=12&ct=1448493737&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https:%2F%2Fsnt150.mail.live.com%2Fdefault.aspx%3Frru%3Dinbox&lc=1033&id=64855&mkt=en-us&cbcxt=mai
* Last updated by: Ken Conner on 11/25/2015 @ 4:22 PM *
@ Ken Conner,
Thank you very much. Me thought, Google has made some security changes in early November. It killed a lot of my time.
My business domain <which is Yahoo Small Business> is ok now, there is no more 501 Syntax Error. I changed <From Address> to exactly same as loggin address to SMTP server. Earlier with Google SMTP server, whatever I wrote on <From Address> does not effect on email sending.
But now I just wondering, whether two devices are login to SMTP server at the same time what will happen as I got not enough resourse such as loggers, modem, SIM card etc at office. Now I'm expericing one of my datalogger's email sending is intermittent while the other is ok to send email hourly or on demand.
Yesterday, I tried a few email services all are working except Google and Outlook. Google was stopped at "220 2.0.0 Ready to Start TLS". Outlook was not allowed to send from unsecured device, and even bolck my email address, it says, "We noticed unusal activities and your email address is temporariraly blocked".
1) Apple Server: "smtp.mail.me.com:587"
2) Yahoo Server: "smtp.mail.yahoo.com:587"
3) Yahoo Small Business Server: "smtp.bizmail.yahoo.com:587"
whether you assigned the port "587" or not, I found out it doesn't matter and even if you assigend "25" also works.
But as I mentioned earlier, <From Address> must be exactly same as <Server Login Email Address>.
Thanks
Hello Ken,
Are you guys working on a solution for this problem with the gmail server?
Perhaps a CR1000 firmware update?
Kind regards
luifgranada,
Engineering is looking into it and we'll hopefully have some more details this week. If a solution can be reached, it will most definitely require an OS update.
My advice is to start looking for an alternative to GMail or to using email all together with the CR1000/CR800/CR850. Even if a work around can be found an implemented in a future OS it will be some time before the new OS is tested and ready to be released.
Hello Ken,
We are actually using gmail because the CR1000 can't send emails with our office 365 email accounts. I asked for support to Campbell almost three months ago but I didn't get any answer, the problem is what I have already described at the beginning of this post. We should be able to send emails from business accounts and not only free accounts.
Thanks
Ken Conner, as you suggested, I set up a gmx.com email account to use as the from address, but got the "221 gmx.com Service closing transmission channel" EMailResult. I have tried several different receiving email addresses, all failed. The smtp server I used was: mail.gmx.com:25. Do I need to changing some setting of the gmx account. Thank you.
Campbell should provide a generic email account to send messages. I'm just telling an generic email address to work as a sender.
it's not a complicated or expensive solution.
We're on 2015, providers must offer a complete solution for the products they sell, it's unbelievable that the users must spend so much time/money to solve this kind of issues.
If Campbell offers an emailSend function, at least they should offer an alternative server that works.
Rgds.
Cici,
Try using mail.gmx.com:587 for the smtp server address.
What will happen if GMX change their security policies?
Ken,
Thanks for the reply. Both 25 and 587 worked, I made a mistake, all the mailed went to the junk mail folder which I forgot to check.
Jlillo,
Great feedback and something that we've discussed here a number of times.
Since 2006, the CR1000 EmailSend instruction has been able to solve customer problems. Since 2009, Gmail has been a popular (but not sole) free solution to the problem of where a free hosted email service can be accessed.
EmailSend() was a solution we provided at the request of customers in spite of the fact that we offer data collection through our own "complete solution" in the form of PakBus/TCP to LoggerNet. In 2015, a cloud solution can be found in the form of professional, pay-for, services like
Konect GDS
https://www.konectgds.com/LandingSite/default.aspx
Eagle IO
https://eagle.io/
Vista Data Vision
http://www.vistadatavision.com/hosting/
If Campbell Scientific offers a SMTP service it will likely be a paid for service. Though it may not be "complicated or expensive", it is not trivial to host and provide a secure, highly available, email server solution. Please remember that Gmail, Yahoo, etc are free because ... well they are not free ... they make money through targeted advertising based on account activity information. I may be wrong, but I have a feeling that if we offer access to a controlled email service that users will continue to seek out free email services elsewhere.
Again, thanks for the great feedback. It is in line with discussions we've had here also.
Sam
Ken/Sam,
Has there been an update from engineering on whether or not a firmware update will be able to solve this issue with gmail? Or is the best solution still to switch to one of the other free email services listed above?
Thanks
BJasperson,
There hasn't been any official word yet, but I would seek an alternate email service. I have been steering people towards Yahoo mail, just because I've received the most feedback about it.
Thanks,
Ken
I learned from my son last night that Google offers alternatives to the standard gmail SMTP. These alternatives are described in the following link:
https://support.google.com/a/answer/176600
Apparently google offers a service that does not require authentication no the use of TLS. The limitation of this is that the service can only transmit mail to other gmail or google accounts. Despite this limitation, there may some value in it. There is another option that uses the source IP address for authentication (thus requiring a static IP address). With this option, the use of TLS is optional.
Hi Ken/Sam,
the gmail smtp server works on CR6 but it doesn't go beyong "220 2.0.0 Ready to start TLS " on CR1000. I also setup a gmx account and tried using the mail.gmx.com with port 587, 25 and 465 but still it doesn't go beyond 220 OK. i tried sending the mail to gmail or the gmx account itself but didn't succeed.
I am using email to get alert message from our weather stations in case the battery voltage go below 10Vdc. I don't know how else can i get these alerts using loggernet itself. is there a way? currently, i am thinking to send battery voltage data from my loggers to CR6 in my network which will then send email to my mail account in case any of them drops below 10Vdc but i don't think this is the way to go.
I saw Campbell released a new OS29 with quite a lot of revisions but this TLS issue still remains. When can we expect Campbell to address the email issue in their most popular CR1000 logger?
Thanks,
Tauha
The very soon released OS 30 will make it so the CR1000/CR3000/CR8X0 dataloggers will be able to use the GMX mail service.
A new feature was added to EmailSend() which will allow you to put the type of authorization you want the datalogger to use when working with a email server. In GMX's case you would enter "username; PLAIN" in the UserName option.
The CR1000/CR3000/CR8X0 dataloggers are not be able to work with Gmail at this point. Google has drastically reduced the time allowed to respond to TLS authentication and these dataloggers can not parse the certificate before the timeout expires. The CR6 and CR300 dataloggers, which are faster, can use Gmail with EmailSend() until some point in the future when Gmail changes their authentication protcol again.
Is there an available reference for the changes to EMAILSEND and EMAILREC in OS30?
I was wondering why one one logger running OS29 I have no issue with GMX and SENDMAIL but on the new logger I just setup with OS30 the identical program fails at 220 OK. Perhaps the changes in OS29 to OS30 are the cause?
I will change to 'username;PLAIN' as mentioned above and see if that helps.
update: that worked for Emailsend