none
Is there anyway to increase the size limit on a "mailto" function?

    Question

  •  

    Hello,

     

    I have a vb.net app that has the functionality to open up an email client, and send off an email.

     

    The problem I'm facing is when the "body" object of the mailto function exceeds 256 characters, I get access denied when it attempts to send the email.

     

    Here is the code where the program fails:

     

    Diagnostics.Process.Start("mailto: " & SendTo & "&subject=" & Subject & "&body" & Body)

     

    I need to have the email client pop up so that the end user can add comments to the body if need be.

     

    I have included Web.HttpUtility.UrlEncode against the Body variable to handle any special characters in the text.

     

    Thanks in advance

    Thursday, March 06, 2008 6:04 PM

Answers

  •  

    Issue is resolved.

     

    I've decided to add a reference to the Outlook Object Library.

     

    Dim oApp As Outlook.Application = New Outlook.Application()

    ' Get the namespace and the logon.

    Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")

    ' Create a new contact item.

    Dim oComposeEmail As Outlook.MailItem = oApp.CreateItem(Outlook.OlItemType.olMailItem)

    oComposeEmail.To = To.Text

    oComposeEmail.Body = Body.Text

     

    oComposeEmail.Save()

     

    oComposeEmail.Display(True)

     

    oNS.Logoff()

    ' Clean up.

    oApp = Nothing

    oNS = Nothing

    oComposeEmail = Nothing

    Monday, March 10, 2008 4:01 PM