I have been trying for hours to send form output via E-mail.
I have got it working, but the body only outputs 1 line.
Please see code below
and the resulting e-mail is as below
The e-mail only outputs the last line in Body from the script, please can anyone help?
I have got it working, but the body only outputs 1 line.
Please see code below
Private Sub Logcall_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
If Err Then 'Outlook is not open
Set olApp = CreateObject("Outlook.Application") 'Create a new instance
End If
'Create e-mail item
Set objMail = olApp.CreateItem(olMailItem)
With objMail
'Set body format to HTML
.To = Email_Address
.Cc = "test@test.co.uk"
.Subject = "Call Ref CR000" & (Me.Call_Number) & " > " & (Me.Contract) & " > " & (Me.Call_Title)
.Body = ""
.Body = "System Support SharePoint "
.Body = "You have Successfully Logged a call with the System Support Team. Your Call Reference is :" & Me.Call_Number
.Body = ("The details of the call are as follows : - ") & (Me.Extra_Information)
.Body = ("Contract : -") & (Me.Contract)
.Body = ("Call Title : - ") & (Me.Call_Title)
.Body = (Me.Select1) & " > " & (Me.Select2) & " > " & (Me.Select3) & " > " & (Me.Select4)
.Body = ("Call Details: - ")
.Body = (Me.Extra_Information)
.send
End With
MsgBox "Call Logged Successfuly Your Call Ref Number is " & "CR000" & Me.Call_Number
End Sub
and the resulting e-mail is as below
Subject: Call Ref CR0003 > Test > Firewall Exception
Body
Please open extra Ports
The e-mail only outputs the last line in Body from the script, please can anyone help?