← Foro de Visual Basic

Mandar correos

Hilo en el foro de Visual Basic · 04 de Marzo del 2003 · 1 respuestas
Christopher04 de Marzo del 2003
Pregunta
Quiero hacer un programita para mandar correos, sin recivir ni nada, solo mandar cierta informacion, como un formulario y poner send y mandarlo a un correo, como le hago, o si ya existe uno, de donde lo bajo

Respuestas 1

Itxaso04 de Marzo del 2003
Espero que te sirva

Dim appOutl As Outlook.Application
Dim maiMail As MailItem
Dim recMessage As Recipient
Dim booRecip As Boolean

' Set a reference to the Outlook Application object.
Set appOutl = New Outlook.Application

' Set a reference to the MailItem object.
Set maiMail = appOutl.CreateItem(olMailItem)

With maiMail
' Get an address from the user.
Set recMessage = .Recipients.Add(InputBox("Enter name of message recipient", "Recipient Name"))

' Attempt to resolve the recipient against an address book.
booRecip = recMessage.Resolve

' Add subject and body text.
.Subject = "Testing mail by Automation"
.Body = InputBox("Enter the amendmends and comentaires", "rejection message")

' Send the mail.
.Send
End With

' Close object references.
''Set appOutl = Nothing
''Set maiMail = Nothing
''Set recMessage = Nothing
¿Buscas más hilos como este? Mira el foro de Visual Basic o usa el buscador.