Sub Mail()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''' ATTENZIONE RICHIEDE L'ATTIVAZIONE DELLA LIBRERIA MICROSOFT OUTLOOK 14.0 OBJECT LIBRARY '''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''' Per l'attivazione andare su "Strumenti", "Riferimenti", cercare e spuntare il nome '''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim indirizzo As String
Dim oOUT As Outlook.Application
Dim oML As MailItem
Dim messaggio As String
Dim oggetto As String
messaggio = "tuo messaggio"
oggetto = "tuo oggetto"
indirizzo = "Pippo@Pappo.it"
Set oOUT = CreateObject("Outlook.Application")
Set oML = oOUT.CreateItem(olMailItem)
With oML
'.Attachments.Add ("C: uo_file.pdf")
.to = indirizzo
.Subject = oggetto
.body = messaggio
.SentOnBehalfOfName = "ilmio@mittente.com"
.Display
'.Send
End With
Set oOUT = Nothing
Set oML = Nothing
End Sub |