I have sub that send email thru outllok, but can't figure out how to CC or BCC to this sub. Is anyone knows? Please help.
Sub MySendMail(recipient,msg,subject)
Dim objSession, oInbox, colMessages, oMessage, colRecipients
Set objSession = CreateObject("MAPI.Session")
strServer = "CUEXCHANGE"
strMyMailbox = "IUSR"
strProfileInfo = strServer & vbLf & strMyMailbox
objSession.Logon "", "", False, True, 0, True, strProfileInfo
Set oInbox = objSession.Inbox
Set colMessages = oInbox.Messages
Set oMessage = colMessages.Add()
Set colRecipients = oMessage.Recipients
colRecipients.Add recipient
colRecipients.Resolve
oMessage.Subject = subject
oMessage.Text = msg
oMessage.Send
objSession.Logoff
Set objSession = nothing
End Sub
Sub MySendMail(recipient,msg,subject)
Dim objSession, oInbox, colMessages, oMessage, colRecipients
Set objSession = CreateObject("MAPI.Session")
strServer = "CUEXCHANGE"
strMyMailbox = "IUSR"
strProfileInfo = strServer & vbLf & strMyMailbox
objSession.Logon "", "", False, True, 0, True, strProfileInfo
Set oInbox = objSession.Inbox
Set colMessages = oInbox.Messages
Set oMessage = colMessages.Add()
Set colRecipients = oMessage.Recipients
colRecipients.Add recipient
colRecipients.Resolve
oMessage.Subject = subject
oMessage.Text = msg
oMessage.Send
objSession.Logoff
Set objSession = nothing
End Sub