runShellCommand

I built a shell script sending mail by curl.
It works from command line as expected.

#include <Process.h>

void setup() 
{
  Bridge.begin();   	// Initialize the Bridge
  Serial.begin(9600);   // Initialize the Serial

  // Wait until a Serial Monitor is connected.
  while(!Serial);
  Serial.println("Sending Mail..."); 

  Process p;        // Create a process and call it "p"
  p.runShellCommand("/$HOME/sendmail.sh");  
  while(p.running());
  while (p.available()>0) 
  {
    char c = p.read();
    Serial.print(c);
  }
  Serial.flush();
  Serial.println("End."); 
}

void loop()
{
  // nothing to do
}

In the monitor I can see the both serial outputs from the sketch and two echos from my shell script.
An email I receive only when I run the shell script but not the sketch.

sendmail.png

sendmail.sh (237 Bytes)

Can you also post the sendmail script? At first glance, your sketch looks right to me

I added the script as an attachment.

sendmail.sh (237 Bytes)

I guess the problem is with that --upload-file mail.txt. Try using an absolute path

Using an absolute path works. Thanks for your support.