web-msg-sender 配置https 协议

1.启动失败情况出现如下错误

Waring stream_socket_server has been disabled for security reasons in …

失败原因:

  1. stream_socket_server 函数被php.ini禁用

解决方法:

  1. 运行php --ini 找到php.ini文件
  2. 打开php.ini找到disable_functions一项,将stream_socket_server禁用项删掉

注意:workerman.log 仅用于记录workerman自身相关启停等日志. 如果启动不成功会写入日志

2.客户端常见报错,手册地址: http://doc.workerman.net/faq/client-connect-fail.html

注意:连接失败客户端一般会有两种报错,connection refuse 和 connection timeout

connection refuse(连接拒绝)

一般是以下原因:
1、客户端连接的端口错了
2、客户端连接的域名或者ip错了
3、如果客户端使用了域名连接,域名可能指向了错误的服务器ip
4、服务端没有启动或者端口没有被监听
5

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Spring Boot应用程序中使用电子邮件服务需要添加spring-boot-starter-mail依赖。在pom.xml文件中添加以下依赖: ```xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> ``` 然后在application.properties或application.yml文件中配置以下内容: ### application.properties ```properties #SMTP服务器地址 spring.mail.host=smtp.example.com #SMTP服务器端口 spring.mail.port=587 #登录SMTP服务器的用户名和密码 spring.mail.username=user[email protected] spring.mail.password=secret #是否启用安全连接 spring.mail.properties.mail.smtp.starttls.enable=true #字符集 spring.mail.default-encoding=UTF-8 ``` ### application.yml ```yaml spring: mail: host: smtp.example.com port: 587 username: user[email protected] password: secret properties: mail.smtp.starttls.enable: true default-encoding: UTF-8 ``` 如果需要使用SSL连接,则可以在application.properties或application.yml文件中将其配置为: ### application.properties ```properties spring.mail.host=smtp.gmail.com spring.mail.port=465 spring.mail.username=user[email protected] spring.mail.password=secret spring.mail.properties.mail.smtps.auth=true spring.mail.properties.mail.smtps.socketFactory.port=465 spring.mail.properties.mail.smtps.socketFactory.class=javax.net.ssl.SSLSocketFactory spring.mail.properties.mail.smtps.socketFactory.fallback=false ``` ### application.yml ```yaml spring: mail: host: smtp.gmail.com port: 465 username: user[email protected] password: secret properties: mail.smtps.auth: true mail.smtps.socketFactory.port: 465 mail.smtps.socketFactory.class: javax.net.ssl.SSLSocketFactory mail.smtps.socketFactory.fallback: false ``` 此外,您还可以在Java代码中使用JavaMailSender接口来发送电子邮件。请参考以下示例: ```java @Autowired private JavaMailSender mailSender; public void sendEmail() { SimpleMailMessage message = new SimpleMailMessage(); message.setFrom("sender@example.com"); message.setTo("[email protected]"); message.setSubject("Spring Boot Email"); message.setText("Hello, World!"); mailSender.send(message); } ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值