on 07-21-2005 1:10 PM
hi all
i have a requirement in which i have to use message object of DI api but i am unable to use it.
plz anybody tell me how to use this object and how to send mails via B1.
Thanks
vishwas srivastava
Private Sub btnSendMsg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendMsg.Click
Dim oMessage As SAPbobsCOM.Messages
'Get a new message object
oMessage = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oMessages)
'Assign some header data
oMessage.Subject = "Hello SDK"
oMessage.MessageText = "SKD Test Message"
oMessage.Priority = SAPbobsCOM.BoMsgPriorities.pr_Low
'Add valid recipients (can be more than one) and add the message
oMessage.Recipients.UserCode = oCompany.UserName
'oMessage.Recipients.NameTo = oCompany.UserName
oMessage.Recipients.SendInternal = SAPbobsCOM.BoYesNoEnum.tYES
'Mail - if you don't supply the mail address
'here, SBO will use the users defined e-mail
'address in Administration-Definitions-General-Def Users
'oMessage.Recipients.EmailAddress = ...
oMessage.Recipients.SendEmail = SAPbobsCOM.BoYesNoEnum.tYES
'Add the recipient record
oMessage.Recipients.Add()
' Adding the new order document
lRetCode = oMessage.Add
'Check Return Code
If lRetCode <> 0 Then
oCompany.GetLastError(lErrCode, sErrMsg)
MsgBox("Error : " & lErrCode & " : " & sErrMsg)
Else
MsgBox("Added Message")
End If
oMessage = Nothing
End Sub
NB -> you have to set up the SBO Mailer service -> supply your smtp server address
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thanx dear for your valuable help this has helped me a lot in understanding the mailing concept in B1,
and i am know also able to send mails internally
but dear there is still a problem that i want to send
external mails although you have given a note in your mail but i am unalbe to utilize it.
so dear plz tell me how to do the required setting (SMPT mailer address) in SBO (where to find it)
that you have mentioned in the mail.
Thanks.
User | Count |
---|---|
101 | |
14 | |
10 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.