how do you sendmail using tls 1.2 and 1.3

조회 수: 56 (최근 30일)
Roar Rawr
Roar Rawr 2022년 7월 17일
답변: Samay Sagar 2024년 9월 26일
Hi, this is my current send mail setting, but said they will not allow the usage of TLS 1.0 or TLS 1.1 anymore.
"For email connections between your devices or programs and our email servers to continue working after deactivation, they must support TLS 1.2 or higher."
So what do I need to do to switch to use TLS 1.2 or 1.3
setpref('Internet','SMTP_Server','smtp.ionos.com');
setpref('Internet','E_mail','myemail.com');
setpref('Internet','SMTP_Username','username');
setpref('Internet','SMTP_Password','password');
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');
sendmail('txt,'txt)
  댓글 수: 2
Andrew Janke
Andrew Janke 2023년 11월 28일
Hi all! Anyone found an answer with this? I haven't been able to get it working. I tried adding this:
props.setProperty('mail.smtp.starttls.enable', 'true');
props.setProperty('mail.smtp.ssl.protocols', 'TLSv1.2');
based on this SO discussion here, but no luck. With AWS SES, I'm still getting a "TLS 1.2 required" error like this:
Error using sendmail
554 Access denied: Amazon SES no longer supports TLS 1.0 and TLS 1.1 connections. You must update your client to use TLS version 1.2 or above. To learn more and to update your client, see https://go.aws/3AUlVSb. For further
assistance, contact AWS support
Looking at the Java JARs shipped with Matlab R2023b, seems like it's still bundling JavaMail 1.4 from 2006. One answer on that SO post says they needed to upgrade to JavaMail 1.5 or even 1.6 in addition to setting those properties. Maybe that's needed with Matlab, and could be done by putting a newer javax-mail JAR on the path ahead of the shipped JARs, or hacking the system classpath? Or maybe these properties need to be set earlier so they're present at library initialization time, and need to be done in a java.opts file instead of by calling props.setProperty() in M-code like done here?
Roar Rawr
Roar Rawr 2023년 11월 28일
I actually found the solution to this, the solution is actually not lies in the matlab code, it is the way matlab communicate with the email server, in my case, it was gmail that i needed to work on

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

답변 (1개)

Samay Sagar
Samay Sagar 2024년 9월 26일

카테고리

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

태그

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by