none
Add hyperlink in email message body in outlook which opens on a button click in asp.net RRS feed

  • Question

  • I want to open outlook email message with To, CC, Subject and some message in the body. I have the following code and it works with all except the message body which shows the whole path instead of the word Link.

    Dim email As String = outPutParameter2.Value.ToString()
            If email <> String.Empty Then
                Dim url As String = "mailto:" + email
                Dim subject As String
                Dim msgBody As String
                Dim ProjLink As String = "Click on the <a href=\'http://abc.gov/Facts/ProjectDetails.aspx?project_pk=" + strProjectid + "\'>Link</a>"
                subject = "?subject=Returned Facts Review For Project Number " + strProjNo
                msgBody = "&body=The Facts review has been returned. To check click " + ProjLink
                url = url + subject + msgBody
                ClientScript.RegisterStartupScript(Me.GetType(), "OpenWin", "<script>openNewWin('" & url & "');</script>")
            End If

    Please help to the right direction!

    Thanks,

    Tuesday, June 20, 2017 12:17 PM

All replies

  • If you want to edit the message before sending, look at Kendo UI library, here is a simple demo I did, another one a bit more to it.

    From second example

    Bottom of toolbar I've inserted a button to send the message which you could pass to your C# code and do a SMTP message where the MailMessage is setup for the body to be HTML. 

    See the following page for SMTP class

    http://www.systemnetmail.com/default.aspx


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Tuesday, June 20, 2017 12:43 PM
  • Thanks a lot for answering. I don't have much option to use other library or tool.
    Tuesday, June 20, 2017 1:44 PM
  • Since this is an ASP.NET app I would recommend posting your question to an ASP.NET forum:

    https://forums.asp.net/


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Tuesday, June 20, 2017 2:13 PM