Xinyuan-LilyGO / LilyGO-T-SIM7000G

LilyGO T-SIM7000G
https://pt.aliexpress.com/item/4000542688096.html
293 stars 128 forks source link

Can SIM7000G send an Email ? #88

Closed TravisDuck999 closed 3 years ago

TravisDuck999 commented 3 years ago

I have tried a few different ways and I can't seem to get a sucessful send of an email.

I am using a gmail account so it might be a SSL connection problem but there has to be a way around this right ?

The first tutorial I came accross was this : http://www.raviyp.com/sim900-gprs-email-at-commands/

All goes well unitl the very last command and then I get "+SMTPSEND: 65"

I would like to know if this module can even send emails ? The fact that it gets this far is a good sign but I never seem to get a full success.

I have the lastest firmware, updated today, the code I am suing is below:

   SerialAT.println("AT"); // hand shake
   updateSerial();
   SerialAT.println("AT+SAPBR=3,1,\"Contype\",\"GPRS\""); // SET UP CONNECTION TO GPRS
   updateSerial();
   SerialAT.println("AT+SAPBR=3,1,\"APN\",\"lte.vodacom.za\"");  // CONNECT WITH APN SETTINGS
   updateSerial();
   SerialAT.println("AT+SAPBR=1,1");  //ENABLE GPRS
   updateSerial();
   SerialAT.println("AT+SAPBR=2,1");  // Check if there is an IP address

   SerialAT.println("AT+EMAILCID=1"); // make email profile identifier
   updateSerial();
   SerialAT.println("AT+EMAILTO=30");  // Set timeout value to enter email data.
   updateSerial();
   SerialAT.println("AT+EMAILSSL=1");
   SerialAT.println("AT+SMTPSRV=\"smtp.google.com\",587"); // mail SMTP setting and port number
   SerialAT.println("AT+SMTPAUTH=1,\"my_sender_email@gmail.com\",\"Password\"");// giving credentials
   SerialAT.println("AT+SMTPFROM=\"my_sender_email@gmail.com\",\"Sender_Name\"");//From detials
   SerialAT.println("AT+SMTPRCPT=0,0,\"my_recvier_email@gmail.com\",\"Rec_name\""); // To details
   SerialAT.println("AT+SMTPSUB=\"subject line\"");  // Subject

   SerialAT.println("AT+SMTPBODY=4");  // body of email
   SerialAT.println("Test");
   SerialAT.println("AT+SMTPSEND"); // send Email

This give me back all OK's besides the very last command with replys "+SMTPSEND: 65"

If anyone knows what I am doing wrong or if this is even allowed it would be a great help, I am trying to get the device to send a low warning email.

TravisDuck999 commented 3 years ago

To all those wondering or trying to send emails with Gmail.

The problem is SSL and gmail, I used private domain name and it worked fine on port 587.

I doubt if Yahoo, hotmail or any of the other big free emails would work either.

My problem was solved by changing email providers, I still have SMTP Authentication on port 587 so I am happy with what I have going on now.