필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
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일
  댓글 수: 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일
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월 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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Web Services에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by