salve,
sto cercando di inviare posta con microsoft outlook e questo codice funziona,
Dim oApp As Outlook._Application
oApp = New Outlook.Application()
' Create a new MailItem.
Dim oMsg As Outlook._MailItem
oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)
oMsg.Subject = "Send Attachment Using OOM in Visual Basic .NET"
oMsg.Body = "Hello World" & vbCr & vbCr
' TODO: Replace with a valid e-mail address.
oMsg.To = "a@hotmail.com"
' Add an attachment
' TODO: Replace with a valid attachment path.
Dim sSource As String = "C:\Documents and Settings\manuela\Desktop\a.txt"
' TODO: Replace with attachment name
Dim sDisplayName As String = "a.txt"
'qui
Dim sBodyLen As String = oMsg.Body.Length
Dim oAttachs As Outlook.Attachments = oMsg.Attachments
Dim oAttach As Outlook.Attachment
oAttach = oAttachs.Add(sSource, , sBodyLen + 1, sDisplayName)
'qui
' Send
'oApp.Session.ExchangeConnectionMode
oMsg.Send()
' Clean up
oApp = Nothing
oMsg = Nothing
oAttach = Nothing
oAttachs = Nothing
però si apre sempre una finestra di outlook che afferma:
Un programma sta tentando di inviare la posta utilizzando il comando Voce.Invia
Un programma sta tentando di inviare automaticamente un messaggio di posta elettronica utilizzando il comando Item.Send di Microsoft Visual Basic (VBA). Se si desidera che questo programma invii il messaggio di posta elettronica, scegliere Sì. Per arrestare il programma, scegliere No. Se non si è sicuri di quale sia il programma che sta inviando il messaggio di posta elettronica o della ragione dell'invio, è consigliabile scegliere No per evitare ogni possibile diffusione di virus.
qualcuno sa dirmi da cosa dipende e come fare per evitare che appaia e blocchi l'invio?
grazie