Sendmail error using gmail: 550-5.7.1 This message is not RFC 5322 compliant. There are multiple To headers.

48 次查看(过去 30 天)
I have a code that compiles some data and plots, places it into a report, and then sends it to the intended receipients. I prefer using Matlab's internal sendmail function (hopefully) with a 'throwaway' Gmail address as opposed to Outlook using activeX due to it's cross-platform compatibility. Prior to April of 2023 I could send to multiple 'To' addresses using sendmail though my Gmail account, but since then I've not been able to, receving this error:
% Error using sendhtmlemail
% 550-5.7.1 This message is not RFC 5322 compliant. There are multiple To headers.
From Google documentation I can tell that this compliancy was enacted in April of 2023, matching my experience. I can send the emails to the receipients in a loop without issue, but then any responses to the messages lack all contributors. Is there any known work-around for this issue?
Using this setup for Gmail:
setpref('Internet','E_mail','foo@gmail.com');
setpref('Internet','SMTP_Server','smtp.gmail.com');
setpref('Internet','SMTP_Username','foo@gmail.com');
setpref('Internet','SMTP_Password','foopassword');
props = java.lang.System.getProperties;
props.setProperty('mail.smtp.auth','true');
props.setProperty('mail.smtp.socketFactory.class', 'javax.net.ssl.SSLSocketFactory');
props.setProperty('mail.smtp.socketFactory.port','465');
I've been using a windows machine running outlook since the problem started, but was hoping to move back to a new apple silicon machine in 2024.
Thanks for any input.

采纳的回答

Ganesh
Ganesh 2024-1-2
编辑:Ganesh 2024-1-3
Hi Oran,
I understand that you are unable to enter multiple recipients, and this is a known issue due to the policy change made by Google.
At the moment, you do not have any workarounds for the same. The issue may be fixed in future releases of MATLAB.
Hope this helps!

更多回答(0 个)

标签

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by