Hello community,
i am trying to get a smal project to work. Via pushbutton an email should be send via the A6. SMS is working, but i did not found any for eMail. And no, SIMM900 commands seems to be not compatible.
This is the relevant part of the code. Variables (sender, server...) were already created.
Anybody any experiences with the A6 and email?
Thanks Thomas
//Function used to send a Mail
void Send_MAIL () {
Serial.println("Selection format message Mail");
A6GSM.println("AT+CREG=0,5");
delay(200);
A6GSM.println("AT+SAPBR=1,1");
delay(200);
A6GSM.println("AT+SAPBR=2,1");
delay(200);
A6GSM.println("AT+EMAILCID=1");
delay(200);
A6GSM.println("AT+SMTPSRV=\"%s\",%s", smtp_server, smtp_port);
A6GSM.println("OK", 2000);
A6GSM.println("AT+SMTPAUTH=1,\"%s\",\"%s\"", smtp_user_name, smtp_password);
A6GSM.println("OK", 2000);
A6GSM.println("AT+SMTPFROM=\"%s\",\"%s\"", sender_address, sender_name);
A6GSM.println("OK", 2000);
A6GSM.println("AT+SMTPRCPT=,0,\"%s\",\"%s\"", to_address, to_name);
A6GSM.println("OK", 2000);
A6GSM.println("AT+SMTPSUB=\"%s\"", subject);
A6GSM.println("OK", 2000);
A6GSM.println("AT+SMTPBODY=\"%s\"", body);
A6GSM.println("OK", 2000);
A6GSM.println("AT+CGSOCKCONT=1,\"IP\",\"%s\"", apn);
A6GSM.println("OK", 2000);
A6GSM.println("AT+CGSOCKAUTH=1,1,\"%s\",\"%s\"", user_name, password);
A6GSM.println("OK", 2000);
answer = A6GSM.println("AT+SMTPSEND", "+SMTP: SUCCESS", 60000);
if (answer == 1)
{Serial.println("Done!");}
else {Serial.println("Error");
}
