Sending e-mail
조회 수: 18 (최근 30일)
이전 댓글 표시
I am sending an e-mail from MatLab using the following code:
h = actxserver('outlook.application'); mail = h.CreateItem('olMail'); mail.Subject = mTitle; mail.BodyFormat = 'olFormatHTML'; mail.HTMLBody = Text;
Text is string with multiple lines in it. How can I tell Outlook that I need carriage return or two after each line?
댓글 수: 0
채택된 답변
Jiro Doke
2011년 2월 21일
I was able to do it by changing the Body property (instead of HTMLBody):
mail.Body = sprintf('This is line one.\nThis is line two.');
댓글 수: 0
추가 답변 (2개)
Walter Roberson
2011년 2월 21일
HTML is independent of line boundaries, so there might not be a method provided for that. Code <br> or <P> where you need line breaks.
댓글 수: 0
Adam Jems
2018년 9월 25일
I also tried this code but I was unable to send email to matlab through my account .i don't know is this due to my firewall or something else .whenever I try to send it shows an error message . for more details regarding this visit - AT&T Email Support
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Web Services에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!