c#发送邮件 邮箱不可用,System.Net.Mail.SmtpException:'邮箱不可用。服务器响应为:未执行请求的邮件操作:邮箱不可用'...

由于Yahoo更改了用户验证方式,使用C#的System.Net.Mail发送邮件时遇到'邮箱不可用'的问题。不再推荐使用'允许使用较不安全的应用登录'选项。解决方案是通过OAuth2进行身份验证,需要注册应用,获取并使用授权令牌来替代用户名和密码。文章提到了使用第三方库MailBee.Net进行OAuth2流程的实现。
摘要由CSDN通过智能技术生成

I am getting this message since Yahoo have made changes in user authentication.

My code still works if I use option suggested by Yahoo, which is:

While you switch apps or update your app, you can give the old app

temporary access. Just remember, this is not intended for permanent

access and you'll want to turn it off afterwards. Turn on Allow apps

that use less secure sign in. Once the feature is turned on, you'll

get regular alerts reminding you to turn it off...

My question is how to update my code to work without turning on

Allow apps that use less secure sign in.

On Yahoo side?

Code:

private void Test_Click(object sender, EventArgs e)

{

MailMessage mail = new MailMessage("userid@yahoo.com", "user@example.com", "Test", "Hello World&#

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值