Problem sending email from asp.net page

Discussion in 'ASP.NET / ASP.NET Core' started by blabberblog, Mar 11, 2004.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. 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
     
  2. 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
     
  3. Bruce

    Bruce DiscountASP.NET Staff

    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?
    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">
     
  4. I am sure. The body is very long around 2K worth. I cannot figure this out.

    oMessage.Priority = MailPriority.Normal;
    oMessage.From = "[email protected]";
    oMessage.To = "[email protected]";
    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.
     
  5. i meant "localhost"
     
  6. Bruce

    Bruce DiscountASP.NET Staff

    that is interesting information. thanks

    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">
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page