Cov txheej txheem:

Yuav Ua Li Cas Xa Email Nrog Cov Ntawv Txuas Nrog Arduino, Esp32 thiab Esp8266: 6 Cov Kauj Ruam
Yuav Ua Li Cas Xa Email Nrog Cov Ntawv Txuas Nrog Arduino, Esp32 thiab Esp8266: 6 Cov Kauj Ruam

Video: Yuav Ua Li Cas Xa Email Nrog Cov Ntawv Txuas Nrog Arduino, Esp32 thiab Esp8266: 6 Cov Kauj Ruam

Video: Yuav Ua Li Cas Xa Email Nrog Cov Ntawv Txuas Nrog Arduino, Esp32 thiab Esp8266: 6 Cov Kauj Ruam
Video: Saib Mis paub Poj niam (hluas nkauj) tus yam ntxwv lub siab 2024, Hlis ntuj nqeg
Anonim
Yuav Ua Li Cas Xa Email Nrog Cov Ntawv Txuas Nrog Arduino, Esp32 thiab Esp8266
Yuav Ua Li Cas Xa Email Nrog Cov Ntawv Txuas Nrog Arduino, Esp32 thiab Esp8266

Nov kuv xav piav qhia qhov version 2 ntawm kuv lub tsev qiv ntawv EMailSender, kev hloov pauv loj rau hwm version 1, nrog kev txhawb nqa rau Arduino nrog w5100, w5200 thiab w5500 ethernet shield thiab enc28J60 clone devices, thiab txhawb nqa esp32 thiab esp8266.

Tam sim no koj tuaj yeem ntxiv cov ntawv txuas ntxiv, thauj khoom los ntawm cov khoom siv xws li SD lossis SPIFFS. Nov yog siv Arduino ethernet.

Khoom siv

  • Arduino Mega Cov
  • wb 28j60
  • SD daim npav

Kauj Ruam 1: Xaiv Qhov Ntaus Ntaus ENC28J60 lossis W5100 Series

Xaiv Qhov Ntaus Ntaus ENC28J60 lossis W5100 Series
Xaiv Qhov Ntaus Ntaus ENC28J60 lossis W5100 Series

Arduino, ib txwm, tswj hwm network nrog cov cuab yeej sab nraud, cov cuab yeej siv zoo li w5100 siv Ethernet lub tsev qiv ntawv clones ENC28J60 muaj qee lub tsev qiv ntawv los xaiv.

Txhawm rau xaiv koj lub cuab yeej koj yuav tsum mus rau EMailSenderKey.h cov ntaub ntawv hauv tsev qiv ntawv thiab teeb tsa qhov raug

#define DEFAULT_EMAIL_NETWORK_TYPE_ARDUINO NETWORK_ENC28J60 // Default

Lub tsev qiv ntawv thauj khoom los tswj cov khoom siv no yog UIPEthernet, koj tuaj yeem nrhiav lub tsev qiv ntawv ntawm tus thawj tswj tsev qiv ntawv ntawm Arduino IDE

lossis koj tuaj yeem hloov pauv hom network tsis raug

#define DEFAULT_EMAIL_NETWORK_TYPE_ARDUINO NETWORK_W5100

Nov yog tus qauv siv thiab siv Ethernet lub tsev qiv ntawv.

Ib qho tseem ceeb xav los txiav txim siab yog qhov thaiv Ethernet no tsis txhawb SSL lossis TLS, yog li koj yuav tsum nrhiav tus muab kev pabcuam SMTP uas muab kev sib txuas SMTP tsis muaj hom kev sau npe no.

Kuv tsim cov ncauj lus ntawm lub rooj sab laj uas koj tuaj yeem ntxiv tus muab kev pabcuam koj siv, uas koj tuaj yeem pom kuv li thiab.

Kauj ruam 2: Xa Email yooj yim

Xa Email yooj yim
Xa Email yooj yim

Txhawm rau xa email nrog Arduino koj yuav tsum nrhiav tus muab kev pabcuam uas ua haujlwm tsis muaj SSL lossis TLS, Rau kuv qhov kev daws teeb meem kuv siv nrog tus muab kev pabcuam SendGrid.

Kuv xav tias kev siv yog yooj yim heev.

Yog li koj yuav tsum teeb tsa tus muab kev pabcuam

E-mail Xa Ntawv email ("KOJ-SENDGRID-API-KEY", "KOJ-SENDGRID-PASSWD", "FROM-EMAIL", "smtp.sendgrid.net", 25);

Tshaj li koj yuav tsum tsim cov lus thiab xa Nws

EMailSender:: EMailMessage lus; message.subject = "Soggetto"; message.message = "Ciao tuaj staiio Bene.

EMailSender:: Response resp = emailSend.send ("[email protected]", lus);

Serial.println ("Xa xwm txheej:");

Serial.println (resp.status);

Serial.println (resp.code); Serial.println (resp.desc);

Kauj Ruam 3: Txuas SD Laub los Tswj Cov Ntawv Txuas

Txuas SD Laub los Tswj Cov Ntawv Txuas
Txuas SD Laub los Tswj Cov Ntawv Txuas

Txhawm rau xa cov ntawv txuas koj yuav tsum txuas daim npav SD zoo li hauv cov phiaj xwm, yog tias koj xav tau cov ntaub ntawv ntau ntxiv txog kev txuas txuas ntxiv rau kab lus no "Yuav siv SD daim npav nrog esp8266, esp32 thiab Arduino" li cas.

Kauj ruam 4: Xa Email Nrog Attachments

Txhawm rau xa email nrog cov ntawv txuas koj yuav tsum nrhiav tus muab kev pabcuam uas txhawb nqa lub luag haujlwm ntawd, kuv tus muab kev pabcuam xa ntawv tsis txhawb qhov ntawd thiab GMX tus muab kev pabcuam uas kuv siv rau qhov kev xeem tsis muaj kev txhawb nqa ntxiv.

Tab sis yog tias koj pom tus muab kev pabcuam tshiab koj tuaj yeem siv tus lej no txhawm rau xa cov ntaub ntawv.

EMailSender:: FileDescriptior fileDescriptor [1]; fileDescriptor [0].filename = F ("test.txt"); fileDescriptor [0].url = F ("/test.txt"); fileDescriptor [0].mime = MIME_TEXT_PLAIN; fileDescriptor [0].encode64 = tsis tseeb; fileDescriptor [0].storageType = EMailSender:: EMAIL_STORAGE_TYPE_SD;

EMailSender:: Attachments attachments = {1, fileDescriptor};

EMailSender:: Response resp = emailSend.send ("[email protected]", lus, xa)

Kauj Ruam 5: Qhov tshwm sim

Qhov tshwm sim
Qhov tshwm sim

Nov yog email xa nrog esp8266 thiab GMail tus muab kev pabcuam (kom siv GMail koj yuav tsum tau txais kev pabcuam sab nraud).

Kauj Ruam 6: Tsev qiv ntawv

Koj tuaj yeem nrhiav lub tsev qiv ntawv ntawm GitHub

Thiab koj yuav tsum nug cov yam ntxwv lossis tshaj tawm cov kab ntawm Lub Rooj Sib Tham

Cov ntaub ntawv ntxiv ntawm no.

Pom zoo: