SMS WORKING

Dependencies:   EthernetInterface NTPClient SimpleSMTPClient TextLCD mbed-rtos mbed

Fork of Application-SimpleSMTPClient_HelloWorld by avnish aggarwal

Files at this revision

API Documentation at this revision

Comitter:
sunifu
Date:
Wed Dec 12 08:45:51 2012 +0000
Parent:
2:e001878f6874
Child:
4:89d1b1db4605
Commit message:
Ver1.01 Update SimpleSMTPClient

Changed in this revision

SimpleSMTPClient.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/SimpleSMTPClient.lib	Mon Dec 03 10:08:30 2012 +0000
+++ b/SimpleSMTPClient.lib	Wed Dec 12 08:45:51 2012 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/sunifu/code/SimpleSMTPClient/#3ea21ce21fe1
+http://mbed.org/users/sunifu/code/SimpleSMTPClient/#27053679f44b
--- a/main.cpp	Mon Dec 03 10:08:30 2012 +0000
+++ b/main.cpp	Wed Dec 12 08:45:51 2012 +0000
@@ -7,8 +7,9 @@
 #include "SimpleSMTPClient.h"
 #include "TextLCD.h"
 
+#define DOMAIN "DOMAIN"
 #define SERVER "smtp.mailserver.domain"
-#define PORT "587" //25 or 587(OutBound Port25 Blocking )
+#define PORT "25" //25 or 587,465(OutBound Port25 Blocking )
 #define USER "user-id"
 #define PWD "password"
 #define FROM_ADDRESS "user-id@domain"
@@ -31,9 +32,14 @@
     printf("Setting up ...\n");
     eth.init();
     eth.connect();
-
     printf("Connected OK\n");
 
+    // IP Address 
+    printf("IP Address is %s\n", eth.getIPAddress());
+    lcd.locate(0,1);
+    lcd.printf("%s", eth.getIPAddress());
+
+    // NTP Client
     printf("NTP setTime...\n");
     NTPClient ntp;
     ntp.setTime("pool.ntp.org");
@@ -45,10 +51,6 @@
     lcd.locate(0,0);
     lcd.printf("[%s]",strTimeMsg);
 
-    // IP Address 
-    printf("IP Address is %s\n", eth.getIPAddress());
-    lcd.locate(0,1);
-    lcd.printf("%s", eth.getIPAddress());
 
     SimpleSMTPClient smtp;
     int ret;
@@ -58,8 +60,8 @@
     smtp.setToAddress(TO_ADDRESS);
     smtp.setMessage(SUBJECT,msg);
     smtp.addMessage("TEST TEST TEST\r\n");
-   
-    ret = smtp.sendmail(SERVER, USER, PWD, PORT,SMTP_AUTH_PLAIN);
+  
+    ret = smtp.sendmail(SERVER, USER, PWD, DOMAIN,PORT,SMTP_AUTH_NONE);
  
     if (ret) {
         printf("E-mail Transmission Error\r\n");