Hello!
I´m using the script below to Forward SMS to email. If the SMS has only one row, everthing works like a charme. When the SMS has more then one row, the sendingprocedure fails and I get an error "invalid Body" ind log. Any Ideas?
:local EmailAddress "xxxx.yyyy@zzz.at";
:local smsPhone;
:local smsTimeStamp;
:local smsMessage;
:local smsContent;
# Get System Identity #
:local SystemID [/system identity get name];
:log info "SMS to Email script started";
# Set Receive Enabled, in case it was cleared by a router reboot #
/tool sms set receive-enabled=yes;
delay 1;
/tool sms set port=lte1
delay 1;
# loop through all the messages in the inbox #
:foreach i in=[/tool sms inbox find] do={
:set smsPhone [/tool sms inbox get $i phone];
:set smsTimeStamp [/tool sms inbox get $i timestamp];
:set smsMessage [/tool sms inbox get $i message];
:set smsContent "$SystemID \_SMS Received from: $smsPhone\_Date&Time: $smsTimeStamp \_Message: $smsMessage";
:log info $smsContent;
/tool e-mail send start-tls=yes subject="$SystemID GSM Modem SMS Received" to=$EmailAddress body="$smsContent";
# Now remove the SMS from the inbox #
/tool sms inbox remove $i;
delay 5;
}
:log info "SMS to Email script complete"
Kind regards