R
Robson Siqueira
Folks,
I've been experiencing a weird problem. I have a web service which sends an
email after its processing. The email always has an PDF attachment on it.
The PDF size vary overtime.
The problem is that everytime the PDF size is equal to or less than 200 KB,
the email is just not being sent. There are no error messages, nothing.
Here is a piece of code.
[WebMethod]
public string TestSendEmail(string email)
{
string[] files = Directory.GetFiles(@"c:\temp", "*.pdf");
for(int i = 0; i < files.Length; i++)
{
MailMessage msg = new MailMessage(new
MailAddress("(e-mail address removed)"), new MailAddress(email));
msg.Subject = "test";
msg.Body = "test";
try
{
Attachment at = new Attachment(files);
msg.Attachments.Add(at);
}
catch (Exception ex)
{
EventLog.WriteEntry("test", ex.ToString(),
EventLogEntryType.Error);
}
SmtpClient c = new SmtpClient("mysmtpserverIP");
c.Send(msg);
}
return "success";
}
What happens is that all attachments which size is bigger than 200KB are
sent normally. The other files, don't
Any thoughts?
I've been experiencing a weird problem. I have a web service which sends an
email after its processing. The email always has an PDF attachment on it.
The PDF size vary overtime.
The problem is that everytime the PDF size is equal to or less than 200 KB,
the email is just not being sent. There are no error messages, nothing.
Here is a piece of code.
[WebMethod]
public string TestSendEmail(string email)
{
string[] files = Directory.GetFiles(@"c:\temp", "*.pdf");
for(int i = 0; i < files.Length; i++)
{
MailMessage msg = new MailMessage(new
MailAddress("(e-mail address removed)"), new MailAddress(email));
msg.Subject = "test";
msg.Body = "test";
try
{
Attachment at = new Attachment(files);
msg.Attachments.Add(at);
}
catch (Exception ex)
{
EventLog.WriteEntry("test", ex.ToString(),
EventLogEntryType.Error);
}
SmtpClient c = new SmtpClient("mysmtpserverIP");
c.Send(msg);
}
return "success";
}
What happens is that all attachments which size is bigger than 200KB are
sent normally. The other files, don't
Any thoughts?