Torna al Thread
'------------------------------------------------
' funzioni per mandare mail con outlook
'------------------------------------------------
Private Sub Apri_Outlook_per_Inviare_Email(ByVal sEmailRecipient As String, ByVal sEmailSubject As String, ByVal sEmailBody As String, ByVal filename As String, ByVal cc1 As String, ByVal cc2 As String)
Dim b1 As Boolean
b1 = False
Try
AxMAPISession1.DownLoadMail = False
AxMAPISession1.SignOff()
Catch
End Try
'****************************************************
Try
AxMAPISession1.DownLoadMail = False
AxMAPISession1.SignOn()
If filename <> "" Then
b1 = True
End If
With AxMAPIMessages1
.SessionID = AxMAPISession1.SessionID
.Compose()
'Set the recipients
.RecipIndex = 0
.RecipType = 1
.RecipDisplayName = sEmailRecipient
If cc1 <> "-" Then
.RecipIndex = 1
.RecipType = 2
.RecipDisplayName = cc1
End If
If cc2 <> "-" Then
.RecipIndex = 2
.RecipType = 2
.RecipDisplayName = cc2
End If
.AddressResolveUI = True
.ResolveName()
.MsgSubject = sEmailSubject
If b1 = True Then
.AttachmentPathName = filename
End If
.MsgNoteText = sEmailBody
.Send(True)
End With
AxMAPISession1.SignOff()
Catch
End Try
End Sub