How to extend sendmail wrapping

3 views (last 30 days)
József Vass
József Vass on 12 Jul 2022
Commented: Jonas on 14 Jul 2022
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)?

Accepted Answer

Jonas on 12 Jul 2022
Edited: Jonas on 12 Jul 2022
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
maxChars=ceil(maxChars); % to avoid non integer input
% ...
body = formatText(theMessage,maxChars);
% ...
function toSend = formatText(msgText,maxChars)
% ...
maxLineLength = maxChars;
% ...
then you would be more flexible in amount of character wrapping
Jonas on 14 Jul 2022
nice to hear. have a nice day!

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by