If not IsVoid(itemVO.email) then
Dim baseReportStamp As String = "z202203232140187890069486"
Dim result As PHCResult = SDK.Report.GenerateReport("FT", baseReportStamp, itemVO.ftstamp,1)
If Not result.HasErrors() Then
Dim filename As String = result.result.Cast(Of StringVO).FirstOrDefault.phcString
Dim emailAttachments As New List(Of FileAttachment)
emailAttachments.Add(sdk.FileUtil.getFile(filename))
Dim emailSubject = itemVO.nome
Dim emailbody As String = "Dear customer, please see attached. Don’t hesitate to reach out if you have any questions."
If sdk.email.send("admin@phcfx.pt", "eteixeira@phcsoftware.com", emailSubject, emailbody, True,emailAttachments)
listMsg.Add(New MsgInfo("The e-mail has been sent to customer"))
End If
End If
End If