How to extend sendmail wrapping

조회 수: 2 (최근 30일)
József Vass
József Vass 2022년 7월 12일
댓글: Jonas 2022년 7월 14일
The sendmail function page at:
states that "sendmail automatically wraps text at 75 characters".
How do I increase this limit, or turn off wrapping altogether (preferably)?

채택된 답변

Jonas
Jonas 2022년 7월 12일
편집: Jonas 2022년 7월 12일
type
edit sendmail
and look into
function toSend = formatText(msgText)
there you can find the line
maxLineLength = 75;
which you can set to inf
you could also change the sendmail function and add another variable by changing the head of the function sendmail and formatText to e.g.
function sendmail(to,subject,theMessage,attachments,maxChars)
if nargin<5 || isempty(maxChars) || ~isnumeric(maxChars) || maxChars<=0
maxChars=75; % define some default
else
maxChars=ceil(maxChars); % to avoid non integer input
end
% ...
body = formatText(theMessage,maxChars);
% ...
function toSend = formatText(msgText,maxChars)
% ...
maxLineLength = maxChars;
% ...
then you would be more flexible in amount of character wrapping
  댓글 수: 2
József Vass
József Vass 2022년 7월 14일
Thanks a lot! I made a copy of sendmail.m called MySendMail.m, and modified it as per your suggestions. It's working as intended.
Jonas
Jonas 2022년 7월 14일
nice to hear. have a nice day!

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by