Add break in email html body (1 Viewer)

aman

Registered User.
Local time
Yesterday, 22:40
Joined
Oct 16, 2008
Messages
1,250
Hi All

I have written the following code to add database link to the email. The only thing is all the text goes in 1 line only even if I use vbcr,vbnewline etc..

Code:
Public Sub SendEmail()
    
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)
    Dim myLink As String
    myLink = "L:\Database1.Accdb"
    With MailOutLook
    
      .To = DLookup("[Email]", "tblStaff", "[strUser]='" & NameofUser() & "'")
       
       .Subject = FName & " needs to be signed off"
       .HTMLBody = FName & " has been completed by " & DLookup("[Staff Name]", "tblstaff", "struser='" & NameofUser() & "'") & "." & vbCrLf & vbCrLf & "The Reference number is " & gRef & ". " & vbNewLine & vbNewLine & "Please click on this link to review and sign off: <a href='" & myLink & "'>Click me</a>." 
    End If
     
    .sEnd
    End With
End Sub
 

aman

Registered User.
Local time
Yesterday, 22:40
Joined
Oct 16, 2008
Messages
1,250
That's great JHB. Many Thanks :)
 

JHB

Have been here a while
Local time
Today, 06:40
Joined
Jun 17, 2012
Messages
7,732
You're welcome, good luck. :)
 

Users who are viewing this thread

Top Bottom