SmtpClient无法发送大小超过15 MB的电子邮件,而手动(来自outlook)可以使用相同的帐户和配置发送 [英] SmtpClient cannot send email with size greater than 15 MBs, while manually (from outlook) can send with the same account and configuration

查看:274
本文介绍了SmtpClient无法发送大小超过15 MB的电子邮件,而手动(来自outlook)可以使用相同的帐户和配置发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发winform应用程序(c#.Net 4.6)

I'm working on winform application (c# .Net 4.6)

在我的代码中,有一个发送电子邮件的模块(附件)

In my code, there is a module which sends an email (with attachment)

现在,我们的一个客户端面临一个问题,即如果附件大于15 MB,则在所有附件少于15 MB的邮件成功发送时,不会发送邮件。

Now, one of our client is facing an issue where if attachment is greater than 15 MBs, mail is not being sent while all mails with attachment less than 15 MBs are being sent successfully.

他已确认电子邮件的最大大小限制由其管理员设置为50 MB。此外,他还可以使用outlook(具有相同的帐户和配置)发送更大的附件。

He has confirmed that max size limit for an email is set to 50 MBs by his administrator, And Also He is able to send such larger attachment using outlook (with same account and configuration).

执行以下行时没有错误,但发送后不久他从邮件服务器收到一封电子邮件,因为邮件大于允许。

There is no error while performing the following line, but soon after sending he gets an e-mail from mail server that mail cannot be sent as it is larger than allowed.

smtpClinet.Send(mailMessage);

在这种情况下可能出现什么问题?

what can be the possible issue in this case?

推荐答案

你好,

系统m.Net.Mail.SmtpClient - 对附件大小没有限制。

System.Net.Mail.SmtpClient - didn't have limitation on attachment size.

但是邮件传输的时间有限制。

But there are limitation on time for message transfer.

检查Timeout属性的值。

Check value on Timeout property.

如果将Send()包装到try-catch并发布错误详细信息,这也会有所帮助。

It's also would be helpful if you wrap Send() into try-catch and post an error details.





这篇关于SmtpClient无法发送大小超过15 MB的电子邮件,而手动(来自outlook)可以使用相同的帐户和配置发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆