Existing Alarm SMS&Email through SMTP

I have an Aritech cs450 alarm panel with 10 zones, 4 digi and 6 analogue.
I have been using this sketch for the last 2 1/2 years with no problems on a Leonardo and wiznet ethernet shield.

It works perfectly now 2 years ago it used to go to sleep after a couple of days, so I added the email when Hall door is opened option to keep it awake.

I know the coding looks childish, however I can understand it, however it is over 9000 characters so I had to chop off the end, start and middle!.

The attached .ino is complete

My Problem is that my ISP is going to need ssl on their SMTP server. Arduino can't do SSL

I know surferTim's code for Gmail works but I cant get Tim's code to marry into mine.

Is there a stripped down version of tims code without the serial stuff.

/*

http://forum.freetronics.com/viewtopic.php?t=1816
By David Blake Sept 2012
Don't connect Digi pin 4,6,12  with wiz ethernet shield and Leonardo
0,1,2,3,5,7,8,9,10,11 work only


http://provideyourown.com/2012/arduino-leonardo-versus-uno-whats-new/


A8 – D8
A9 – D9
A10 – D10
A11 – D12
The original 6 analog input pins have new digital pins mappings as well. They are:
    A6 – D4
A6 = A7 – D6
A7 = A8  – D8
A8 = A9  – D9
A9 = A10 – D10
//LED     =  D11
//A9 = A11 – D12


*/

#include <SPI.h>
#include <Ethernet.h>


// Network Details
byte mac[] = {  0xDE, 0xAD, 0xBE, 0xEF, 0x00, 0x36 }; //physical mac address
IPAddress ip( 192, 168, 1, 36 );
IPAddress gateway( 192, 168, 1, 1 );
IPAddress subnet( 255, 255, 255, 0 );
char serverName[] = "213.46.255.2"; //Start/Access/CommandPrompt/ nslookup smtp.upcmail.ie
char Emailsender[] = "MAIL From: me@upcmail.ie";
char Email1[] = "RCPT To: me@eircom.net";
char Email2[] = "RCPT To: 3538******4@txtlocal.co.uk";
char Email3[] = "RCPT To: 4478******9@txtlocal.co.uk";
char Email4[] = "RCPT To: me@gmail.ie";
EthernetClient client;



// These intergers are used as constants to control timing and delays in the script
int wait = 500; //used for a basic 0.5 second delay in places
int wait1 = 1500; //used for a basic 0.5 second delay in places

// These integers represent pin numbers and initial states for working out which inputs are armed or have fired

i
    {
      digitalWrite(Led1, HIGH);
      delay(wait); /* allow the router to identify the Arduino before the Arduino connects to the internet */
      Ethernet.begin(mac, ip, dns, gateway );
      delay(wait);
      if (client.connect(serverName, 25)) {
        Serial.println("connected");
      }
      else {
        Serial.println("connection failed");
      }
      delay(wait);

      Serial.print("SMS Int Siren ");
      Serial.println(inputstatus6);
      client.println(F("HELO itismeletschat")); // say hello to the SMTP server.
      delay(wait); // Give time for response
      client.println(Emailsender); // identify sender
      delay(wait);
      client.println(Email1); // identify 2nd recipient
      delay(wait);
      client.println(Email2); // identify 2nd recipient
      delay(wait);
      client.println(F("DATA")); // announce start of message
      delay(wait);
      client.println(F("Subject: Int Siren")); // insert subject
      client.println(F("")); // insert 2 blank lines between subject and body
      client.println(F("#%#")); // insert 1 blank line to start of body
      client.println(F("")); // insert 2 blank lines between subject and body
      // Now tell them which inputs have fired or are still armed
      client.println(F("SMS Ext Siren"));
      client.println(F("%n"));

      if (inputstatus0 == 0) {
        client.print(" ARMED,     "), client.println(F("%n"));
      }
      else {
        client.print(" UN-ARMED,"), client.println(F("%n"));
      }

AritechAlarm25.ino (26.1 KB)

Comment out the serial stuff.

You can't use ssl on the Arduino. Are you certain your ISP requires ssl? Some don't. Some require a user and password, and others require only that you send the email from one of their IP addresses.

Hi Tim,
Thanks for your interest.
My ISP started last week requiring SSL on port 25 of their SMTP relay server.
I know this after testing and using telnet, hence my sketch won't work now.

I can get your email sketch to work with gmail smtp:25 without authorisation, it works well and gives a lot of feedback through the serial port.
but I can't marry the two sketches.

Does some one have a basic stripped down version of your sketch,

Another reason for looking for the stripped down version is my existing sketch takes up a lot of space on my arduino already

The only way you can strip it down is to comment out the Serial.print stuff. It needs everything else for error checking.

edit: I don't think ssl email on port 25 is supported by most email servers. That is how email servers send email to other email servers. Don't use the SMTP relay server IP. But to use the inbound email server, the destination address must be a user on that domain.

You can also check with your ISP to see if you can send a user/password with the port 25 email relay server. Some will allow that.

Thanks Tim, I'll try that.