Skip to Content
0
Former Member
Dec 29, 2008 at 06:12 AM

Send mail

34 Views

 Private Sub SendMessage(ByVal strSubject As String, ByVal Msg As String)
        Dim objMsg As SAPbobsCOM.Messages
        Dim lngStatus As Long

        Try

            objMsg = objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMessages)
            objMsg.Subject = strSubject
            objMsg.MessageText = Msg

            objMsg.Recipients.Add()
            objMsg.Recipients.SetCurrentLine(0)
            objMsg.Recipients.UserCode = "manager"
            objMsg.Recipients.EmailAddress = valid email address
            objMsg.Recipients.SendInternal = SAPbobsCOM.BoYesNoEnum.tNO
            objMsg.Recipients.SendEmail = SAPbobsCOM.BoYesNoEnum.tYES
            objMsg.Priority = SAPbobsCOM.BoMsgPriorities.pr_High

            lngStatus = objMsg.Add
            If objCompany.GetLastErrorDescription.Length > 0 Then
                SBO_Application.MessageBox(objCompany.GetLastErrorDescription)
            End If
        Catch ex As Exception
            SBO_Application.MessageBox(ex.Message)
        End Try
    End Sub

I want to send emai through DI API.I have used the above code.

It is not giving any error but I am not receiving email.I want to receive

email and not an message that pop ups in SAP.