Comments on: Sending HTML emails from Matlab https://undocumentedmatlab.com/blog_old/sending-html-emails-from-matlab Charting Matlab's unsupported hidden underbelly Sun, 03 Jul 2022 14:46:57 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: BPolitihttps://undocumentedmatlab.com/blog_old/sending-html-emails-from-matlab#comment-509457 Wed, 27 Nov 2019 11:18:32 +0000 https://undocumentedmatlab.com/?p=6986#comment-509457 Hi,
Thank you for the very nice article! It has helped me a lot and works like a charm :)

One thing with the modified code is that it is necessary to add an attachment to send an HTML format mail (it returns the error “not enough arguments” otherwise).
To change that and be able to send only HTML text, a simple copy of the argument parsing code from the “sendmail” function to the “sendEmail” function works.

Here is the modified code:

function sendEmail(to,subject,theMessage,attachments)
%SENDEMAIL Send e-mail wrapper (with HTML formatting)
% Argument parsing.
  narginchk(2,4);
  if ischar(to)
    to = {to};
  end
  if (nargin < 3)
    theMessage = '';
  end
  if (nargin < 4) 
    attachments = [];
  elseif ischar(attachments)
    attachments = {attachments};
  end
  endmail(to,subject,theMessage,attachments);

I hope it will be useful!

Cheers

]]>
By: matlabihttps://undocumentedmatlab.com/blog_old/sending-html-emails-from-matlab#comment-416388 Mon, 13 Nov 2017 23:05:22 +0000 https://undocumentedmatlab.com/?p=6986#comment-416388 hi
Smtp settings Where should we place?

]]>