
07/07/2005, 06:33
|
| | Fecha de Ingreso: mayo-2005
Mensajes: 93
Antigüedad: 20 años Puntos: 1 | |
Ahí te va una función enterita que lo hace solo.
Problema: El programa que debes tener configurado en el PC para poder enviar mails debe ser el Outlook, no vale con el Outlook Express. Sub Send_Mails(PARA As String, TITULO As String, CUERPO As String, Optional ATTACH As Variant, Optional NOMBREATT As Variant, Optional CONC As String)
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = PARA
.SUBJECT = TITULO
.Body = CUERPO
If Not IsMissing(CONC) And CONC <> "" Then .CC = CONC
If Not IsMissing(ATTACH) Then
If ATTACH <> "" Then
.Attachments.Add ATTACH, olByValue, 1, NOMBREATT
End If
End If
.Send
End With
Set MailOutLook = Nothing
Set appOutLook = Nothing End Sub
__________________ No te hubieran dado la capacidad de soñar sin darte también la posibilidad de convertir tus sueños en realidad |