File Exchange

image thumbnail

Send Messages to Emails and/or Cell Phones

version (5.13 KB) by Georgios Papachristoudis
This function sends messages to emails and/or cell phones (from a Gmail account)


Updated 14 Aug 2019

View Version History

View License

This function sends messages to emails and/or cell phones assuming you are sending from a Gmail account. Support for text messaging only within the US.
You can easily tweak the code to make it send from other accounts (other than Gmail). Please look inside the function help section for more details.

Cite As

Georgios Papachristoudis (2021). Send Messages to Emails and/or Cell Phones (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (6)

Emily Dahl

Brando Miranda

Ignore my previous message. Sorry. I meant to say paste the error message:

Error using sendmail (line 171)
Authentication failed.

Error in send_msg (line 159)

Brando Miranda

This does not work error:

Error using cellfun
Input #2 expected to be a cell array, was char instead.

Error in send_msg (line 73)
I = cellfun(@isnumeric,recipients);

benhebba fayçal

thx very mutch

Daniel R. Herber

Great submission. This provides the exactly functionality I was looking for.

I also wrote some additional code for this submission that can send dynamic notifications. The code demonstrates how to include the command prompt output, total computation time, function name, and even error messages (so you can restart your code). Please find my write-up here:

Daniel R. Herber

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Send Text Message to Cell Phone

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!