my recipients' address to be imported from a database to a textbox. but i keep on getting an error of unknown recipient. please help me with this.
these are my codes for my send button so far
thank you. i really appreciate your help.
these are my codes for my send button so far
Code:
Dim StartPos, Counter As Integer
Dim FindString, ReplaceText As String
FindString = " "
ReplaceText = " ; "
For Counter = 1 To Len(address.Text)
StartPos = InStr(address.Text, FindString)
If StartPos > 0 Then
address.SelStart = StartPos - 1
address.SelLength = Len(FindString)
address.SelText = "" + ReplaceText
End If
Next
Dim s
Dim se() As String
Dim InputContainer As String
InputContainer = address.Text
se() = Split(InputContainer, " ; ")
Dim i As Integer
ListView1.ListItems.clear
For i = 0 To UBound(se)
Set s = ListView1.ListItems.add(, , se(i))
Next
MAPISession1.SignOn
MAPIMessages1.SessionID = MAPISession1.SessionID
'Compose new message
MAPIMessages1.Compose
'Create the message
MAPIMessages1.MsgSubject = subj.Text
MAPIMessages1.MsgNoteText = body.Text
'Address message
Const SESSION_SIGNON = 1
Const MESSAGE_COMPOSE = 6
Const ATTACHTYPE_DATA = 0
Const RECIPTYPE_TO = 1
Const RECIPTYPE_CC = 2
Const MESSAGE_RESOLVENAME = 13
Const MESSAGE_SEND = 3
Const SESSION_SIGNOFF = 2
Dim q As Integer
Dim w As Integer
q = 0
w = 0
Do While q < 3 And w < 3
MAPIMessages1.RecipIndex = q 'First recipient
MAPIMessages1.RecipType = RECIPTYPE_TO 'Recipient in TO line
MAPIMessages1.RecipDisplayName = se(w)
q = q + 1
w = w + 1
Loop
MAPIMessages1.Action = MESSAGE_RESOLVENAME
'Send the message:
MAPIMessages1.Action = MESSAGE_SEND
MAPISession1.SignOff
Comment