PDA

View Full Version : Problem sending email from asp.net page


blabberblog
03-11-2004, 07:46 AM
I solved the problem. Here is the solution for anyone interested:

I was trying to send it as HTML format with the entire HTML in the body. The problem is that for sending email it is required that there be a \carriage return \line feed every 76 characters. The line length cannot be longer than this. So I inserted some \r\n every 50 characters or so and it worked.

Pete

blabberblog
03-11-2004, 10:32 AM
Hi,

I am sending an email using MailMessage. The email is in HTML format. The email gets sent but it is being truncated. Any one have any idea why the email body gets truncated? Is there a limit on the size in HTML format?

TIA

bruce
03-11-2004, 11:50 AM
I don't believe there's a limit in the HTML size limit.

Are you sure you are not truncating the content in the app itself?
[b]quote:Originally posted by blabberblog

Hi,

I am sending an email using MailMessage. The email is in HTML format. The email gets sent but it is being truncated. Any one have any idea why the email body gets truncated? Is there a limit on the size in HTML format?

TIA
</blockquote id="quote"></font id="quote">

blabberblog
03-11-2004, 12:07 PM
I am sure. The body is very long around 2K worth. I cannot figure this out.

oMessage.Priority = MailPriority.Normal;
oMessage.From = "webmaster@bzzznet.net";
oMessage.To = "who@areyou.com";
oMessage.Subject = "Welcome";
string str = "<HTML><HEAD>" +
str += "<META http.... - TO LONG TO POST HERE...

oMessage.Body = str;
SmtpMail.SmtpServer = "lovalhost";
oMessage.BodyFormat = MailFormat.HTML;

// Send the e-mail
SmtpMail.Send(oMessage);

This sends it but it truncates it. I cannot figure this out.

Any help would be appreciated.

blabberblog
03-11-2004, 12:09 PM
i meant "localhost"

bruce
03-12-2004, 02:10 AM
that is interesting information. thanks

[b]quote:Originally posted by blabberblog

I solved the problem. Here is the solution for anyone interested:

I was trying to send it as HTML format with the entire HTML in the body. The problem is that for sending email it is required that there be a \carriage return \line feed every 76 characters. The line length cannot be longer than this. So I inserted some \r\n every 50 characters or so and it worked.

Pete
</blockquote id="quote"></font id="quote">