File Exchange

image thumbnail

Send Email to gmail account

version (813 Bytes) by Pradyumna A
Send Email to gmail account


Updated 10 Jun 2008

No License

SEND_MAIL_MESSAGE is a function which send email to gmail. You need to initially edit the .m file to key in the parameters of your gmail account (like user name and password) from which you would like to send mail.

Cite As

Pradyumna A (2021). Send Email to gmail account (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (10)


Hi Adam,
which setting of gmail should be changed?

Adam Danz

Gmail users will need to change their gmail settings to allow access. You'll be prompted by gmail after trying to send the first email. By changing the settings you're greatly decreasing the security of your email. For this reason, I recommend creating an additional account for sending Matlab emails and make sure it's not associated with your other accounts.

Hannes Mogensen


Lee White

Did the job but needed to mess with the inputs a bit.


Attachment was not optional (R2012b). But some minor modifications fixed it for me.

Pradyumna A

Yes, Dimitri Shvorob. Most of the code if from

John Waldis

Thanks for a nice and simple function. was really useful

Neetha Ramanan

Dimitri Shvorob

It would have been nice to acknowledge the original source:

You are pretty much copy-pasting it.

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

Community Treasure Hunt

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

Start Hunting!