Enviar datos por email
Publicado por Pancho (15 intervenciones) el 27/04/2001 18:07:45
Quisiera desde mi aplicación mandar datos por e-mail. Entre los datos a mandar iria una foto en JPG. Como puedo hacerlo
Gracias
Gracias
Valora esta pregunta
0
Sub EnviarCorreo()
Dim objOutlook As Object
Dim objMail As Object
Dim strMensaje As String
Dim strAsunto As String
Dim strDestinatario As String
Dim strAdjunto As String
'Iniciar Outlook
Set objOutlook = CreateObject("Outlook.Application")
'Crear un nuevo correo
Set objMail = objOutlook.CreateItem(0)
'Establecer el destinatario
strDestinatario = "destinatario@email.com"
objMail.To = strDestinatario
'Establecer el asunto
strAsunto = "Asunto del correo"
objMail.Subject = strAsunto
'Establecer el mensaje
strMensaje = "Este es el cuerpo del mensaje."
objMail.Body = strMensaje
'Establecer la imagen adjunta
strAdjunto = "C:\ruta\de\la\imagen.jpg"
objMail.Attachments.Add strAdjunto, 1, 0
'Enviar el correo
objMail.Send
'Cerrar Outlook
Set objMail = Nothing
Set objOutlook = Nothing
End Sub