How to do something only one time with the measurements of ultrasonic sensor

Hello,
I want to get a message to my phone when the distance equal to 20 cm.
but if again the distance equal to 20 cm I didn't need a message.
I couldn't make it correctly. If someone can help me highly appreciate.

#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 10);

#define trig 7
#define echo 6

String Message;

void setup() {
mySerial.begin(9600);
  Serial.begin(9600);

  pinMode(trig, OUTPUT);
  pinMode(echo, INPUT);

}

void loop() {
  if (mySerial.available() > 0) {
    Message = mySerial.readString();
    Serial.print(Message);
    delay(10);
  }
  digitalWrite(trig, LOW);
  delayMicroseconds(2);
  digitalWrite(trig, HIGH);
  delayMicroseconds(10);
  digitalWrite(trig, LOW);

  long t = pulseIn(echo, HIGH);
  long mm = cm * 10;
  Serial.println(mm);

if (mm == 200) {
    twenty();
    delay(1000);
  }
}

void twenty() {
  digitalWrite(greenBulb, LOW);
  mySerial.println("AT+CMGF=1");
  delay(1000);
  mySerial.println("AT+CMGS=\"phonenumber\"\r");
  delay(1000);
  mySerial.println("only 20cm");
  delay(100);
  mySerial.println((char)26);
  delay(1000);
}

This is the code that I used.
If you can please help me...

Thank you

You seem to have forgotten a pinMode for the trigger pin.
(The echo pin will default to LOW)

if (mm == 200)

Is this a good idea ?
For instance, what if the measurement is 199mm then the next time it is 201mm ?

As to doing something once, make the action dependant on a boolean variable which is initially set to true. Once the something has happened set the boolean to false to prevent it occuring again

Thank you. It's a my fault while I copying the code to here

It works now.
Thank you so much