Hi, I have seen different libraries for using SIM800L, (from Fona, SIM800L.h etc…), but It is still not clear to me which is the best way to send emails with attachments using SIM800L. Thanks to Ravi Blog, I reached out to send emails using a Hosting via terminal. but now I would like to send an email with attachments using an arduino uno. Does any one has any idea or example of this?.
You can add attachment using AT+SMTPFILE command as shown in application note. You cant directly attach from memory , but they show you can enter the file contents byte by byte with lengths asked by the module after SMTPSEND command.
Thank you very much Ravi,
I just need to attach a TXT file. However as you mentioned i think it is necesary to send the content byte by byte. Do you have an example about how to do it, or the only information available is the SIM800L manual?, thanks for everything Ravi. (by now I am only using putty as terminal, however, i should start programming with arduino).
I am very very new in this and need help for a project. Will appreciate If you like and you are able to help. Fof more details please send me an email at email@example.com.
Thank you in advance
hi Ravi in my Journey for using arduino I reached to send sms and phone calls with arduino, however, for some reason when i try to send emails in the line smtp send the reply is error, Can you help me understand what is going on, please?
//Create software serial object to communicate with SIM800L
SoftwareSerial mySerial(3, 2); //SIM800L Tx & Rx is connected to Arduino #3 & #2
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
//Begin serial communication with Arduino and SIM800L
mySerial.println(" AT+SAPBR=3,1,“Contype”,“GPRS” “);
mySerial.println(” AT+SAPBR=1,1 “); //
mySerial.println(” AT+SAPBR=2,1 “); //
mySerial.println(” AT+EMAILCID=1 “); //
mySerial.println(” AT+EMAILTO=30 “); //
mySerial.println(” AT+SMTPSRV=“mailXXXXXXXX”,25 “); // 25 587
mySerial.println(” AT+SMTPAUTH=1,“test@XXXXXXXX”,“XXXX” “); //
mySerial.println(” AT+SMTPRCPT=0,0,“XXXXXXXXXX”,“miguel” “); //
mySerial.println(” AT+SMTPSUB=“test” “); //
mySerial.println(” AT+SMTPBODY=19 “); //
mySerial.print(”\n hello \n");
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
problem solved the lenght of the body should match with the smtpbody
I want to send email with an attachment but I could not send properly and i use below command after
but I got error code 64 smtp server timeout and i increase the timeout number still I am getting that error…
could you give some suggetions to make it work.
unable to write content in text file.
getting error at AT+SMTPFT=100