Hi,
how can I send emails with arduino? I have tried some scripts for virgilio server, but they don't work... do you know anyone?
Hi,
how can I send emails with arduino? I have tried some scripts for virgilio server, but they don't work... do you know anyone?
hello, for me the best way is to send a HTML request to a personnal site on which there is a php file, and this php file will activate an email notification...I must develop this solution for my personnal project but it is still under dev... I hope it is feasable !! feel free to communicate if you have another solution !
Thunder94:
how can I send emails with arduino?
It depends which mail server you're trying to use. Some will accept unsecured SMTP and you can send emails through these fairly easily if you have a network connection - I suspect you'll find sample code but if not it would be easy enough to write from scratch since it's basically just sending a few lines of text. Other mail servers require authentication and/or encryption, which is much harder to implement and I suggest you don't waste your time trying to implement that. If you need to access a secured mail server, the way to do it would be by sending a command to a PC which sends the email for you. Exactly how you implement that on the PC depends what OS and applications you're running on the PC, but for example on Windows you can use Gobetwino to execute commands on the PC, the command would invoke a utility to send the email.
I'm trying to use virgilio server, i have set smtp, ip, username, password, I have uploaded the sketch on arduino but i don't know how to run it! Must I use serial monitor to run the script?
Thunder94:
Hi, how can I send emails with arduino? I have tried some scripts for virgilio server, but they don't work... do you know anyone?
Previous discussions that might have info.
Now i'm trying philou's solution, but how can I do html request to open an internet link? Which is the sketch?
Thunder94:
I have uploaded the sketch on arduino but i don't know how to run it! Must I use serial monitor to run the script?
The sketch runs when the Arduino is powered up.
If you want to see messages that the sketch prints to the serial port then you would need to open the serial port using the Arduino IDE serial monitor, or equivalent. The Arduino will usually be reset when the serial port is opened.
If you're this unsure about how the whole process of writing, uploading and running a sketch then I suggest you play with the standard examples before you try to tackle this sort of problem. In any case, you should not expect people to simply give you a sketch that does exactly what you want. Sometimes you will be pointed to other people's code for ideas and inspiration, and you might occasionally find a sketch that does exactly what you want, but more usually you're expected to write the sketch for yourself and not just expect to have it handed to you.
Yes I know it, but I would like an example of html request to open an internet page, if it were possible... I don't want fully sketch but just fundamentals lines to run it.. or an example
The Ethernet library comes with example server and client sketches.
here are some info for who wants to send email via FREE pages perso :
normally you can send request GET to activate a php script which will be located on Free pages perso (acces libre bas debit - 2000 mails autorisés/sem) but there is a big problem known : 2 or 3 times the mail () function fails (thouhg the result is OK !!) due to saturation of server at free...
I have found a workaround that works nicely : thks to Fonction "mail()" désactivée dans les pages perso avec PHP5 ? and here is my code that works... replace correct address and site !! I hope that it can serve to other guys like me who have searched a long long time before ...why the mail () was not ok ...
maybe free will return a bad "ack" in case of bad treatment in the future...
help !! j'essaye en français vu que les pages free, hen c'est plutot frenchy !
je croyais avoir resolu le pb des mail sur page perso Free et ben, j'ai un pb uniquement sur les requetes issu de l'Arduino :
j'ai un comportement curieux et tres genant pour mon projet! avec la manip decrite par le genial bienfaiteur de mai2013, j'ai appliqué la mesure de temps de reaction suite a la fonction mail() et tout marche bien, a condition d'activer le script php depuis la page perso : je m'explique
je met le fichier Arduino_notif.php qui contient la fonction mail () et tout le toutim de verif de tempo et qd je clique via explorer sur le lien a ce fichier, tout marche nickel... en moyenne, j'ai 2.00xxx sec de reaction...apres 3 tentatives...
(le code PHP a ete posté precedemment : redemandez le moi si necessaire...)
qd j'essaye d'activer le fichier depuis une requete GET envoyé depuis un arduino (microcontrolleur connecté via internet), le fichier est bien activé mais le temps mesuré passe a 0,5 sec... ds le meilleur des cas et en plus j'ai un warning comme quoi le code es tincorrect : or le code n'a pas bougé...
y aurait il une reaction differente selon que le client connecté (arduino donc ou explorer dans l'autre cas) est different ? ça dépasse un peu mes connaissances en ce domaine...
ci joint une copie des remontée de free vers l'arduino (en mode reception de caracteres donc erreur possible de formattage...)
** GESTION notif PHP **
connected
HTTP/1.1 200 OK
Date: Thu, 27 Mar 2014 15:10:36 GMT
Server: Apache/ProXad [Apr 20 2012 15:06:05]
X-Powered-By: PHP/4.4.3-dev
Connection: close
Content-Type: text/html
coupure de courant intervenue ...
à :16:10 le 2014-03-27
reponse= 1
tentative 1, envoi = 0, durée : 0.0006
Warning: mail() [function.mail]: ligne incorrect dans process_login!
in /mnt/104/sdb/b/5/test2561/Arduino_notif.php on line 44
reponse= 1
tentative 2, envoi = 0, durée : 0.6274
reponse= 1
tentative 3, envoi = 0, durée : 0.0006
Warning: mail() [function.mail]: ligne incorrect dans process_login!
in /mnt/104/sdb/b/5/test2561/Arduino_notif.php on line 44
reponse= 1
tentative 4, envoi = 0, durée : 0.5875
reponse= 1
tentative 5, envoi = 0, durée : 0.0006
reponse= 1
tentative 6, envoi = 0, durée : 0.0006
le mail n'a pu être envoyé, réessayez !
disconnecting.
si quelqu'un a une idée quelconque de la direction où chercher...
entete a revoir ? code php a adapter... temps de reaction de l'arduino trop lent par rapport a explorer
merci pour votre aide !!!
PS : en modifiant le temps de pause entre les tentatives d'envoi de mail() en PHP, ça ne change rien voire pire... je sais que Free doit avoir des mecanismes de defense contre les envoi en groupe ou les sites de test...du coup, je teste petit a petit...