Gas detection system

Hello everyone, im trying to make a gas detection system using Arduino Uno and Esp8266-01 and few other components like mq2 gas sensor, buzzer etc. Untill now i got the sensor to read the gas values and i established the serial communication between the Arduino and the Esp and conecting it to the WiFi. The hard part for me is how i could make the arduino to send a notification or an email to an Android phone to alert the user that the gas has leaked. I found some codes on the internet but none of them has worked. Im new to this type of WiFi module and i was wondering if some of you experienced guys could you help me with some materials, advices. Thank you!

The MQ series of sensors are cheap, very unreliable and detect lots of different gases and vapors. They cannot tell the difference between any of the substances they detect.

The MQ series are not intended to be used in any application where human safety or lives are at risk.

So, if you are building a system that is supposed to give safety warnings, make sure that you use a high quality sensor.

"The hard part for me is how i could make the arduino to send a notification or an email to an Android phone to alert the user that the gas has leaked. "

You might use the forum search function and look for email, SMS, and similar terms.

I found this code for the sending the email, but it is used for projects with only the ESP8266 without the Arduino UNO, the ESP8266wifi library provides the routines for the module to conect to wifi. My question is can someone help me make the modifications to the code so that it can be run on the Arduino uno?

#include <ESP8266WiFi.h>

const char* ssid = “SERVER NAME”;
const char* password = “SERVER PASSWORD”;
char server = “mail.smtp2go.com”;

WiFiClient espClient;

void setup()
{
Serial.begin(115200);
delay(10);
Serial.println("");
Serial.println("");
Serial.print("Connecting To: ");
Serial.println(ssid);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println(“WiFi Connected.”);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
byte ret = sendEmail();
}

void loop()
{
}

byte sendEmail()
{
if (espClient.connect(server, 2525) == 1)
{
Serial.println(F(“connected”));
}
else
{
Serial.println(F(“connection failed”));
return 0;
}
if (!emailResp())
return 0;

Serial.println(F(“Sending EHLO”));
espClient.println(“EHLO www.example.com”);
if (!emailResp())
return 0;

espClient.println(“STARTTLS”);
if (!emailResp())
return 0;*/

Serial.println(F(“Sending auth login”));
espClient.println(“AUTH LOGIN”);
if (!emailResp())
return 0;

Serial.println(F(“Sending User”));

espClient.println(“Enter base64, ASCII ENCODED USERNAME”);
if (!emailResp())
return 0;

Serial.println(F(“Sending Password”));

espClient.println(“Enter base64, ASCII ENCODED PASSWORD”);
if (!emailResp())
return 0;

Serial.println(F(“Sending From”));

espClient.println(F(“MAIL From: sender@gmail.com”));
if (!emailResp())
return 0;

Serial.println(F(“Sending To”));
espClient.println(F(“RCPT To: receiver@gmail.com”));
if (!emailResp())
return 0;

Serial.println(F(“Sending DATA”));
espClient.println(F(“DATA”));
if (!emailResp())
return 0;
Serial.println(F(“Sending email”));

espClient.println(F(“To: receiver@gmail.com”));

espClient.println(F(“From: sender@gmail.com”));
espClient.println(F(“Subject: ESP8266 test e-mail\r\n”));
espClient.println(F(“This is is a test e-mail sent from ESP8266.\n”));
espClient.println(F(“Second line of the test e-mail.”));
espClient.println(F(“Third line of the test e-mail.”));

espClient.println(F("."));
if (!emailResp())
return 0;

Serial.println(F(“Sending QUIT”));
espClient.println(F(“QUIT”));
if (!emailResp())
return 0;

espClient.stop();
Serial.println(F(“disconnected”));
return 1;
}

byte emailResp()
{
byte responseCode;
byte readByte;
int loopCount = 0;

while (!espClient.available())
{
delay(1);
loopCount++;
if (loopCount > 20000)
{
espClient.stop();
Serial.println(F("\r\nTimeout"));
return 0;
}
}
responseCode = espClient.peek();
while (espClient.available())
{
readByte = espClient.read();
Serial.write(readByte);
}

if (responseCode >= ‘4’)
{
return 0;
}
return 1;
}