Send email message with attachments

A

Aleksei Pashin

Hi
I am trying to send email message from my ASP.NET page using MailMessage É
SmtpMail.
Message must have the attachment file.
When its size grows 150K I get an error message

System.Runtime.InteropServices.COMException: Unspecified error

TargetInvocationException: Exception has been thrown by the target of an
invocation.]
System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,
Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture,
String[] namedParameters) +0
System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr,
Binder binder, Object target, Object[] args, ParameterModifier[] modifiers,
CultureInfo culture, String[] namedParameters) +473
System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String
methodName, Object[] args) +58


Could you help me to solve this problem.
Thank you
 
A

Aleksei Pashin

Thank you for your reply.
I could successfully send email message from ASP.NET script with attachment.
Message with attachment up to 150K has been sent successfully.
 
G

Girish Bharadwaj

Is it possible that the SMTP server has a size limit on the emails being
sent from there? Can you check the size limit on your SMTP server..
If you run your own IIS Server, check the following:

- Goto IIS Manager
- right-click on "Default SMTP Virtual Server"
- Go to properties/ Messages tab
- Check the "Limit Message Size to" value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top