troubleshooting Question

How to send email using vb.net?

Avatar of Legolas786
Legolas786 asked on
Visual Basic.NET
8 Comments1 Solution382 ViewsLast Modified:
Hi,

its been a pain trying to get my application to compose an email, but i finally managed to get it working but I have a couple questions:-
1) It seems that there is some sort of character limit on the following method, if the text in the body of the email contains a lot of information then it cuts it off at the bottom?
2) I have seen examples of some people being able to change the font type, size and colour of the text - how would I use this with the following coding?


       Dim sParams As String = ""
        Dim emailto As String = "test@test.co.uk"
        Dim subject As String = "test"
        Dim body As String = ""
        Dim LineCounter As Integer = 0
        Dim Lines As String = ""
    
        body = body & "The"
        body = body & "%0A"
        body = body & "%0A" & "Body"
        body = body & "%0A"
        body = body & "%0A" & "Of"
        body = body & "%0A"
        body = body & "%0A" & "The"
        body = body & "%0A"
        body = body & "%0A" & "Email"
        body = body & "%0A"
        body = body & "%0A" & "Goes"
        body = body & "%0A"
        body = body & "%0A" & "Here"

        sParams = "mailto:" & emailto & "?subject=" & subject & "&body=" & body
        Try
            System.Diagnostics.Process.Start(sParams)
        Catch e2 As Exception
            MessageBox.Show("Unable to load email!", "Problem Sending the email", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try

I know there are other methods like smtp but i am happy with the above method as it composes emails in outlook which is perfect, i dont require it to send emails just compose.
ASKER CERTIFIED SOLUTION
Legolas786

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros