I want to send a picture by email to an email address at "Outlook.com" using MATLAB

Hi
I want to send a specific picture to an email address using Matlab gui
I know how to browse and select a picture, but I want to send the picture that I selected to send it to any email.
Thanks :)
See attachment.

 採用された回答

Image Analyst
Image Analyst 2014 年 9 月 11 日

0 投票

1 件のコメント

Image Analyst
Image Analyst 2014 年 9 月 11 日
編集済み: Image Analyst 2014 年 9 月 11 日
% NOTE: CHANGE THE NEXT FEW LINES OF CODE WITH TO REFLECT YOUR SETTINGS.
myUserName = 'me';
myPassword = 'thisismypassword';
mySMTP = 'myserver.mydomain.com';
% Assign the sender's email address.
% It can be an actual, real e-mail address,
% but it does not have to be an account that actually exists -
% you can make up one.
sendersEmail = 'me@mydomain.com';
recipientsEMail = 'somebody@Outlook.com';
% Set your email and SMTP server address in MATLAB.
setpref('Internet', 'SMTP_Server', mySMTP)
setpref('Internet', 'E_mail', sendersEmail)
setpref('Internet','SMTP_Username', myUserName);
setpref('Internet','SMTP_Password', myPassword);
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
% Here's where we actually send out the e-mail with the file attached.
sendmail(recipientsEMail, subjectLine, messageBody, attachedFullFileName)

サインインしてコメントする。

その他の回答 (1 件)

Ken Atwell
Ken Atwell 2014 年 9 月 6 日

0 投票

You can use sendmail, though you will need to save the image to a temporary file (attachments can only be files).

4 件のコメント

Abdullah
Abdullah 2014 年 9 月 6 日
編集済み: Abdullah 2014 年 9 月 6 日
so i can't send a picture using matlab gui to an email?
Image Analyst
Image Analyst 2014 年 9 月 6 日
You can but it needs to be in a file saved to disk rather than directly as a variable right out of the script. If you were to put an image variable into the body of the message it would look like gibberish, so it has to be an attachment. Attachments have to be files saved on your disk.
Abdullah
Abdullah 2014 年 9 月 7 日
okay how can i send an attachment to an email , "like what you said it has yo be an attachment"
what is the code for it?
thanks
Ken Atwell
Ken Atwell 2014 年 9 月 11 日
Trying using a function like imwrite to create a image file on disk, then attached it to the email as one of the parameters to sendmail.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

質問済み:

2014 年 9 月 5 日

編集済み:

2014 年 9 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by