I have combined two codes, one is for distance sensor with email alert which functions perfectly as I created a filter on Gmail as well, so the email arrives to my inbox.
I thought I can get away with a shortcut to use the same "send email" code for my temperature sensor, but the Gmail refuses it with "not RFC 5322 compliant error" which as far as I understood stands for a problem about the subject of the email. I even changed the same subject etc for the temp sensor but it still refuses it.
EDIT: It keeps sending an e mail with an empty Subject which causes the problem.
I'll be really glad if you can find the problem.
The code is in the attachment; ( I changed the ip, email address / username etc.)
and the email reply is;
failed after I sent the message.
Remote host said: 550-5.7.1 [188.121.52.36 11] Our system has detected that this message is
550-5.7.1 not RFC 5322 compliant. To reduce the amount of spam sent to Gmail,
550-5.7.1 this message has been blocked. Please review
550 5.7.1 RFC 5322 specifications for more information. 22si59027451lfa.75 - gsmtp
.......
Thanks a lot...
sketch_ping_thermo_rev2a.ino (8.67 KB)
The email send worked until you combined it with new code? Which Arduino are you using? Is it an Uno?
thank you for the reply.
It is Arduino Uno with ethernet shield.
Both email send is still working. However the distance sensor's alarm email arrives to the inbox but the temperature sensor's alarm gets refused although even if I write the same subject for the email like as in the distance sensor's alarm.
I'm not certain if this has any effect on your problem, but what are you using D13 for? It is the SPI clock pin on an Uno. The ethernet shield uses SPI.
Thank you,
I copy/pasted the codes and modified the alarm part for temperature sensor.
The distance sensor alarm functions perfectly.
D13 is empty.
The Temperature sensor alarm is sending an email with an empty subject which causes the problem.
Thought I do not know how to resolve it. ![:frowning: :frowning:](https://emoji.discourse-cdn.com/twitter/frowning.png?v=12)
If D13 has nothing connected except the SPI bus, then don't manipulate it.
If it is sending an empty subject line, you may have a SRAM problem. Either you are running out of SRAM, or overflowing an array.
edit: You only need send the "From: Me f@y.com" once. It appears you are sending it a few times each email send.
yeap resolved the problem before I saw your post.
deleted some lines (240, 251) and now everything works fine. ![:slight_smile: :slight_smile:](https://emoji.discourse-cdn.com/twitter/slight_smile.png?v=12)
Thanks a lot for your help.