Ask a questionAsk a question
 

AnswerSPUtility.SendEmail Function truncating htmlbody

  • Thursday, February 28, 2008 8:31 AMNitinGupta4u Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

     

    Hi All,

     

    I am sending an email to my sharepoint portal user through SPUtility.SendEmail Function. Its working fine but when ever my message body exceeds 2048 characters it gets truncated by the function.

    Is there any maximum lenght for email message body?

    Please help...

     

     

    Nitin Gupta

Answers

  • Friday, February 29, 2008 2:04 PMToby Statham Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi Nitin,

     

    I would the use System.Net.Mail to send the email. The one provided in SPUtility is a little restrictive. You can use the OutboundMailSenderAddress property of SPWebApplication to get the SMTP address that the server is using.

     

    Cheers

     

All Replies

  • Friday, February 29, 2008 2:04 PMToby Statham Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi Nitin,

     

    I would the use System.Net.Mail to send the email. The one provided in SPUtility is a little restrictive. You can use the OutboundMailSenderAddress property of SPWebApplication to get the SMTP address that the server is using.

     

    Cheers

     

  • Sunday, February 08, 2009 9:36 AMSudheesh Warrier Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Have you got any other solution for this problem?

    I am also facing this issue, and unfortunatly i m not allowed to use "System.Net.Mail" this namespace in my org.
  • Monday, February 23, 2009 11:50 PMAnozireth Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Proposed Answer
    I just ran into this issue as well, and discovered that SPUtility.SendEmail seems to cap the length of a single line.  I added newlines after each tag in the body of my email and it works like a charm.