Sending e-mail

2 ビュー (過去 30 日間)
Kevin O'Hara
Kevin O'Hara 2011 年 2 月 21 日
回答済み: Adam Jems 2018 年 9 月 25 日
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?

採用された回答

Jiro Doke
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.');

その他の回答 (2 件)

Walter Roberson
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.

Adam Jems
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

カテゴリ

Help Center および File ExchangeWeb Services についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by